mirror of
https://github.com/ramsey/uuid.git
synced 2026-06-14 15:56:48 +03:00
Add docblocks for classes and interface in Ramsey\Uuid\Builder namespace
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user