From b3ef99a2e9992ebca9639f5b41032df13860667d Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Thu, 16 Jul 2015 09:54:04 -0500 Subject: [PATCH] Move RandomGeneratorInterface and RandomGeneratorFactory to Generator NS --- src/FeatureSet.php | 1 + src/Generator/CombGenerator.php | 1 - src/Generator/MtRandGenerator.php | 2 -- src/Generator/OpenSslGenerator.php | 2 -- src/{ => Generator}/RandomGeneratorFactory.php | 5 +---- src/{ => Generator}/RandomGeneratorInterface.php | 2 +- src/Generator/RandomLibAdapter.php | 1 - src/UuidFactory.php | 1 + tests/{ => Generator}/RandomGeneratorFactoryTest.php | 4 +++- tests/UuidTest.php | 3 ++- 10 files changed, 9 insertions(+), 13 deletions(-) rename src/{ => Generator}/RandomGeneratorFactory.php (91%) rename src/{ => Generator}/RandomGeneratorInterface.php (95%) rename tests/{ => Generator}/RandomGeneratorFactoryTest.php (91%) diff --git a/src/FeatureSet.php b/src/FeatureSet.php index 2a411b7..04b5e8d 100644 --- a/src/FeatureSet.php +++ b/src/FeatureSet.php @@ -27,6 +27,7 @@ use Ramsey\Uuid\Builder\DefaultUuidBuilder; use Ramsey\Uuid\Codec\StringCodec; use Ramsey\Uuid\Codec\GuidStringCodec; use Ramsey\Uuid\Builder\DegradedUuidBuilder; +use Ramsey\Uuid\Generator\RandomGeneratorFactory; /** * Detects and exposes available features in current environment (32 or 64 bit, available dependencies...) diff --git a/src/Generator/CombGenerator.php b/src/Generator/CombGenerator.php index b2392d9..ae1b168 100644 --- a/src/Generator/CombGenerator.php +++ b/src/Generator/CombGenerator.php @@ -14,7 +14,6 @@ namespace Ramsey\Uuid\Generator; -use Ramsey\Uuid\RandomGeneratorInterface; use Ramsey\Uuid\Converter\NumberConverterInterface; /** diff --git a/src/Generator/MtRandGenerator.php b/src/Generator/MtRandGenerator.php index b1e7ca8..bfffaa4 100644 --- a/src/Generator/MtRandGenerator.php +++ b/src/Generator/MtRandGenerator.php @@ -14,8 +14,6 @@ namespace Ramsey\Uuid\Generator; -use Ramsey\Uuid\RandomGeneratorInterface; - class MtRandGenerator implements RandomGeneratorInterface { public function generate($length) diff --git a/src/Generator/OpenSslGenerator.php b/src/Generator/OpenSslGenerator.php index 1200220..aaa0032 100644 --- a/src/Generator/OpenSslGenerator.php +++ b/src/Generator/OpenSslGenerator.php @@ -14,8 +14,6 @@ namespace Ramsey\Uuid\Generator; -use Ramsey\Uuid\RandomGeneratorInterface; - class OpenSslGenerator implements RandomGeneratorInterface { diff --git a/src/RandomGeneratorFactory.php b/src/Generator/RandomGeneratorFactory.php similarity index 91% rename from src/RandomGeneratorFactory.php rename to src/Generator/RandomGeneratorFactory.php index d0331f3..3dd3883 100644 --- a/src/RandomGeneratorFactory.php +++ b/src/Generator/RandomGeneratorFactory.php @@ -12,10 +12,7 @@ * @link https://github.com/ramsey/uuid GitHub */ -namespace Ramsey\Uuid; - -use Ramsey\Uuid\Generator\OpenSslGenerator; -use Ramsey\Uuid\Generator\MtRandGenerator; +namespace Ramsey\Uuid\Generator; class RandomGeneratorFactory { diff --git a/src/RandomGeneratorInterface.php b/src/Generator/RandomGeneratorInterface.php similarity index 95% rename from src/RandomGeneratorInterface.php rename to src/Generator/RandomGeneratorInterface.php index 029b00d..60e5ac9 100644 --- a/src/RandomGeneratorInterface.php +++ b/src/Generator/RandomGeneratorInterface.php @@ -12,7 +12,7 @@ * @link https://github.com/ramsey/uuid GitHub */ -namespace Ramsey\Uuid; +namespace Ramsey\Uuid\Generator; interface RandomGeneratorInterface { diff --git a/src/Generator/RandomLibAdapter.php b/src/Generator/RandomLibAdapter.php index 2bf4524..501873e 100644 --- a/src/Generator/RandomLibAdapter.php +++ b/src/Generator/RandomLibAdapter.php @@ -16,7 +16,6 @@ namespace Ramsey\Uuid\Generator; use RandomLib\Generator; use RandomLib\Factory; -use Ramsey\Uuid\RandomGeneratorInterface; class RandomLibAdapter implements RandomGeneratorInterface { diff --git a/src/UuidFactory.php b/src/UuidFactory.php index e0ad7d4..2f9e532 100644 --- a/src/UuidFactory.php +++ b/src/UuidFactory.php @@ -19,6 +19,7 @@ use Ramsey\Uuid\Converter\NumberConverterInterface; use Ramsey\Uuid\Converter\TimeConverterInterface; use Ramsey\Uuid\Provider\NodeProviderInterface; use Ramsey\Uuid\Provider\TimeProviderInterface; +use Ramsey\Uuid\Generator\RandomGeneratorInterface; class UuidFactory implements UuidFactoryInterface { diff --git a/tests/RandomGeneratorFactoryTest.php b/tests/Generator/RandomGeneratorFactoryTest.php similarity index 91% rename from tests/RandomGeneratorFactoryTest.php rename to tests/Generator/RandomGeneratorFactoryTest.php index 590a7b4..580974d 100644 --- a/tests/RandomGeneratorFactoryTest.php +++ b/tests/Generator/RandomGeneratorFactoryTest.php @@ -1,6 +1,8 @@ getMock('Ramsey\Uuid\RandomGeneratorInterface'); + $mock = $this->getMock('Ramsey\Uuid\Generator\RandomGeneratorInterface'); $mock->expects($this->any()) ->method('generate') ->willReturnCallback(function ($length)