mirror of
https://github.com/ramsey/uuid.git
synced 2026-06-23 17:28:59 +03:00
Add docblocks for classes and interfaces in Ramsey\Uuid\Generator namespace
This commit is contained in:
@@ -17,10 +17,27 @@ namespace Ramsey\Uuid\Generator;
|
||||
use RandomLib\Generator;
|
||||
use RandomLib\Factory;
|
||||
|
||||
/**
|
||||
* RandomLibAdapter provides functionality to generate strings of random
|
||||
* binary data using the ircmaxell/random-lib library
|
||||
*
|
||||
* @link https://packagist.org/packages/ircmaxell/random-lib
|
||||
*/
|
||||
class RandomLibAdapter implements RandomGeneratorInterface
|
||||
{
|
||||
/**
|
||||
* @var Generator
|
||||
*/
|
||||
private $generator;
|
||||
|
||||
/**
|
||||
* Constructs a `RandomLibAdapter` using a `RandomLib\Generator`
|
||||
*
|
||||
* By default, if no `Generator` is passed in, this creates a medium-strength
|
||||
* generator to use when generating random binary data.
|
||||
*
|
||||
* @param Generator $generator An ircmaxell/random-lib `Generator`
|
||||
*/
|
||||
public function __construct(Generator $generator = null)
|
||||
{
|
||||
$this->generator = $generator;
|
||||
@@ -32,6 +49,12 @@ class RandomLibAdapter implements RandomGeneratorInterface
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
return $this->generator->generate($length);
|
||||
|
||||
Reference in New Issue
Block a user