Add docblocks for classes and interfaces in Ramsey\Uuid\Generator namespace

This commit is contained in:
Ben Ramsey
2015-09-26 19:06:21 -05:00
parent dc26d4addb
commit 5bf7f5064c
12 changed files with 185 additions and 22 deletions
+23
View File
@@ -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);