diff options
author | Mario <mario@mariovavti.com> | 2020-11-27 08:04:00 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2020-11-27 08:04:00 +0000 |
commit | f4bb7bcbff3770387c2fecfa91ce4a60b916a474 (patch) | |
tree | ea007e664d435f1f3d63c87bfe1600484d2bd46c /vendor/ramsey/uuid/src/Generator/RandomLibAdapter.php | |
parent | 07e5b8295ea9d342f66d8119d88bd58124b548e6 (diff) | |
download | volse-hubzilla-f4bb7bcbff3770387c2fecfa91ce4a60b916a474.tar.gz volse-hubzilla-f4bb7bcbff3770387c2fecfa91ce4a60b916a474.tar.bz2 volse-hubzilla-f4bb7bcbff3770387c2fecfa91ce4a60b916a474.zip |
update composer libs
Diffstat (limited to 'vendor/ramsey/uuid/src/Generator/RandomLibAdapter.php')
-rw-r--r-- | vendor/ramsey/uuid/src/Generator/RandomLibAdapter.php | 39 |
1 files changed, 16 insertions, 23 deletions
diff --git a/vendor/ramsey/uuid/src/Generator/RandomLibAdapter.php b/vendor/ramsey/uuid/src/Generator/RandomLibAdapter.php index 5aa0e8865..24ed56920 100644 --- a/vendor/ramsey/uuid/src/Generator/RandomLibAdapter.php +++ b/vendor/ramsey/uuid/src/Generator/RandomLibAdapter.php @@ -1,4 +1,5 @@ <?php + /** * This file is part of the ramsey/uuid library * @@ -7,21 +8,20 @@ * * @copyright Copyright (c) Ben Ramsey <ben@benramsey.com> * @license http://opensource.org/licenses/MIT MIT - * @link https://benramsey.com/projects/ramsey-uuid/ Documentation - * @link https://packagist.org/packages/ramsey/uuid Packagist - * @link https://github.com/ramsey/uuid GitHub */ +declare(strict_types=1); + namespace Ramsey\Uuid\Generator; -use RandomLib\Generator; use RandomLib\Factory; +use RandomLib\Generator; /** - * RandomLibAdapter provides functionality to generate strings of random - * binary data using the paragonie/random-lib library + * RandomLibAdapter generates strings of random binary data using the + * paragonie/random-lib library * - * @link https://packagist.org/packages/paragonie/random-lib + * @link https://packagist.org/packages/paragonie/random-lib paragonie/random-lib */ class RandomLibAdapter implements RandomGeneratorInterface { @@ -31,31 +31,24 @@ class RandomLibAdapter implements RandomGeneratorInterface private $generator; /** - * Constructs a `RandomLibAdapter` using a `RandomLib\Generator` + * Constructs a RandomLibAdapter * - * By default, if no `Generator` is passed in, this creates a high-strength + * By default, if no Generator is passed in, this creates a high-strength * generator to use when generating random binary data. * - * @param Generator $generator An paragonie/random-lib `Generator` + * @param Generator|null $generator The generator to use when generating binary data */ - public function __construct(Generator $generator = null) + public function __construct(?Generator $generator = null) { - $this->generator = $generator; - - if ($this->generator === null) { + if ($generator === null) { $factory = new Factory(); - - $this->generator = $factory->getHighStrengthGenerator(); + $generator = $factory->getHighStrengthGenerator(); } + + $this->generator = $generator; } - /** - * Generates a string of random binary data of the specified length - * - * @param integer $length The number of bytes of random binary data to generate - * @return string A binary string - */ - public function generate($length) + public function generate(int $length): string { return $this->generator->generate($length); } |