mirror of
https://github.com/ramsey/uuid.git
synced 2026-06-19 16:47:23 +03:00
Move RandomGeneratorInterface and RandomGeneratorFactory to Generator NS
This commit is contained in:
@@ -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...)
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
|
||||
namespace Ramsey\Uuid\Generator;
|
||||
|
||||
use Ramsey\Uuid\RandomGeneratorInterface;
|
||||
use Ramsey\Uuid\Converter\NumberConverterInterface;
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,8 +14,6 @@
|
||||
|
||||
namespace Ramsey\Uuid\Generator;
|
||||
|
||||
use Ramsey\Uuid\RandomGeneratorInterface;
|
||||
|
||||
class MtRandGenerator implements RandomGeneratorInterface
|
||||
{
|
||||
public function generate($length)
|
||||
|
||||
@@ -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
|
||||
{
|
||||
@@ -16,7 +16,6 @@ namespace Ramsey\Uuid\Generator;
|
||||
|
||||
use RandomLib\Generator;
|
||||
use RandomLib\Factory;
|
||||
use Ramsey\Uuid\RandomGeneratorInterface;
|
||||
|
||||
class RandomLibAdapter implements RandomGeneratorInterface
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
+3
-1
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Ramsey\Uuid;
|
||||
namespace Ramsey\Uuid\Generator;
|
||||
|
||||
use Ramsey\Uuid\TestCase;
|
||||
|
||||
class RandomGeneratorFactoryTest extends TestCase
|
||||
{
|
||||
+2
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user