Move RandomGeneratorInterface and RandomGeneratorFactory to Generator NS

This commit is contained in:
Ben Ramsey
2015-07-16 09:54:04 -05:00
parent e006f669ad
commit b3ef99a2e9
10 changed files with 9 additions and 13 deletions
+1
View File
@@ -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...)
-1
View File
@@ -14,7 +14,6 @@
namespace Ramsey\Uuid\Generator;
use Ramsey\Uuid\RandomGeneratorInterface;
use Ramsey\Uuid\Converter\NumberConverterInterface;
/**
-2
View File
@@ -14,8 +14,6 @@
namespace Ramsey\Uuid\Generator;
use Ramsey\Uuid\RandomGeneratorInterface;
class MtRandGenerator implements RandomGeneratorInterface
{
public function generate($length)
-2
View File
@@ -14,8 +14,6 @@
namespace Ramsey\Uuid\Generator;
use Ramsey\Uuid\RandomGeneratorInterface;
class OpenSslGenerator implements RandomGeneratorInterface
{
@@ -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
{
@@ -12,7 +12,7 @@
* @link https://github.com/ramsey/uuid GitHub
*/
namespace Ramsey\Uuid;
namespace Ramsey\Uuid\Generator;
interface RandomGeneratorInterface
{
-1
View File
@@ -16,7 +16,6 @@ namespace Ramsey\Uuid\Generator;
use RandomLib\Generator;
use RandomLib\Factory;
use Ramsey\Uuid\RandomGeneratorInterface;
class RandomLibAdapter implements RandomGeneratorInterface
{
+1
View File
@@ -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
{
@@ -1,6 +1,8 @@
<?php
namespace Ramsey\Uuid;
namespace Ramsey\Uuid\Generator;
use Ramsey\Uuid\TestCase;
class RandomGeneratorFactoryTest extends TestCase
{
+2 -1
View File
@@ -5,6 +5,7 @@ namespace Ramsey\Uuid;
use Ramsey\Uuid\Provider\Time\SystemTimeProvider;
use Ramsey\Uuid\Provider\Time\FixedTimeProvider;
use Ramsey\Uuid\Generator\CombGenerator;
use Ramsey\Uuid\Generator\RandomGeneratorFactory;
class UuidTest extends TestCase
{
@@ -792,7 +793,7 @@ class UuidTest extends TestCase
*/
public function testUuid4Comb()
{
$mock = $this->getMock('Ramsey\Uuid\RandomGeneratorInterface');
$mock = $this->getMock('Ramsey\Uuid\Generator\RandomGeneratorInterface');
$mock->expects($this->any())
->method('generate')
->willReturnCallback(function ($length)