Add docblocks for classes and interface in Ramsey\Uuid\Builder namespace

This commit is contained in:
Ben Ramsey
2015-09-03 23:00:55 -04:00
parent d5276bdba6
commit 67fe80dc1b
3 changed files with 51 additions and 6 deletions
+21 -2
View File
@@ -14,20 +14,39 @@
namespace Ramsey\Uuid\Builder;
use Ramsey\Uuid\Converter\NumberConverterInterface;
use Ramsey\Uuid\Codec\CodecInterface;
use Ramsey\Uuid\Converter\NumberConverterInterface;
use Ramsey\Uuid\Uuid;
/**
* DefaultUuidBuilder is the default UUID builder for ramsey/uuid; it builds
* instances of Uuid objects
*/
class DefaultUuidBuilder implements UuidBuilderInterface
{
/**
* @var NumberConverterInterface
*/
private $converter;
/**
* Constructs the DefaultUuidBuilder
*
* @param NumberConverterInterface The number converter to use when constructing the Uuid
*/
public function __construct(NumberConverterInterface $converter)
{
$this->converter = $converter;
}
/**
* Builds a Uuid
*
* @param CodecInterface $codec The codec to use for building this Uuid
* @param array $fields An array of fields from which to construct the Uuid;
* see {@see \Ramsey\Uuid\Uuid::getFields()} for array structure.
* @return Uuid
*/
public function build(CodecInterface $codec, array $fields)
{
return new Uuid($fields, $this->converter, $codec);
+20 -2
View File
@@ -15,19 +15,37 @@
namespace Ramsey\Uuid\Builder;
use Ramsey\Uuid\Codec\CodecInterface;
use Ramsey\Uuid\DegradedUuid;
use Ramsey\Uuid\Converter\NumberConverterInterface;
use Ramsey\Uuid\DegradedUuid;
/**
* DegradedUuidBuilder builds instances of DegradedUuid
*/
class DegradedUuidBuilder implements UuidBuilderInterface
{
/**
* @var NumberConverterInterface
*/
private $converter;
/**
* Constructs the DegradedUuidBuilder
*
* @param NumberConverterInterface The number converter to use when constructing the DegradedUuid
*/
public function __construct(NumberConverterInterface $converter)
{
$this->converter = $converter;
}
/**
* Builds a DegradedUuid
*
* @param CodecInterface $codec The codec to use for building this DegradedUuid
* @param array $fields An array of fields from which to construct the DegradedUuid;
* see {@see \Ramsey\Uuid\Uuid::getFields()} for array structure.
* @return DegradedUuid
*/
public function build(CodecInterface $codec, array $fields)
{
return new DegradedUuid($fields, $this->converter, $codec);
+10 -2
View File
@@ -15,12 +15,20 @@
namespace Ramsey\Uuid\Builder;
use Ramsey\Uuid\Codec\CodecInterface;
use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\UuidInterface;
/**
* UuidBuilderInterface builds instances UuidInterface
*/
interface UuidBuilderInterface
{
/**
* @return Uuid
* Builds an instance of a UuidInterface
*
* @param CodecInterface $codec The codec to use for building this UuidInterface instance
* @param array $fields An array of fields from which to construct a UuidInterface instance;
* see {@see \Ramsey\Uuid\Uuid::getFields()} for array structure.
* @return UuidInterface
*/
public function build(CodecInterface $codec, array $fields);
}