From 67fe80dc1b0f74b1d96d04b2de7bd26f2dca93d9 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Thu, 3 Sep 2015 23:00:55 -0400 Subject: [PATCH] Add docblocks for classes and interface in Ramsey\Uuid\Builder namespace --- src/Builder/DefaultUuidBuilder.php | 23 +++++++++++++++++++++-- src/Builder/DegradedUuidBuilder.php | 22 ++++++++++++++++++++-- src/Builder/UuidBuilderInterface.php | 12 ++++++++++-- 3 files changed, 51 insertions(+), 6 deletions(-) diff --git a/src/Builder/DefaultUuidBuilder.php b/src/Builder/DefaultUuidBuilder.php index 22eece3..50be39f 100644 --- a/src/Builder/DefaultUuidBuilder.php +++ b/src/Builder/DefaultUuidBuilder.php @@ -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); diff --git a/src/Builder/DegradedUuidBuilder.php b/src/Builder/DegradedUuidBuilder.php index e28d8da..bfd9a12 100644 --- a/src/Builder/DegradedUuidBuilder.php +++ b/src/Builder/DegradedUuidBuilder.php @@ -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); diff --git a/src/Builder/UuidBuilderInterface.php b/src/Builder/UuidBuilderInterface.php index f80ec30..39bbe01 100644 --- a/src/Builder/UuidBuilderInterface.php +++ b/src/Builder/UuidBuilderInterface.php @@ -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); }