mirror of
https://github.com/ramsey/uuid.git
synced 2026-06-16 16:17:43 +03:00
Rename degraded feature classes with more consistent names
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Rhumsaa\Uuid;
|
||||
|
||||
class UnsatisfiedNumberConverter extends BigNumberConverter
|
||||
class DegradedNumberConverter extends BigNumberConverter
|
||||
{
|
||||
public function fromHex($hex)
|
||||
{
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Rhumsaa\Uuid;
|
||||
|
||||
class SmallIntUuid extends Uuid
|
||||
class DegradedUuid extends Uuid
|
||||
{
|
||||
|
||||
public function __construct(array $fields, BigNumberConverter $converter, Codec $codec)
|
||||
+2
-2
@@ -243,7 +243,7 @@ class UuidFactory
|
||||
$converter = new BigNumberConverter();
|
||||
|
||||
if (! self::hasBigNumber()) {
|
||||
$converter = new UnsatisfiedNumberConverter();
|
||||
$converter = new DegradedNumberConverter();
|
||||
}
|
||||
|
||||
return $converter;
|
||||
@@ -384,7 +384,7 @@ class UuidFactory
|
||||
$codec = $codec ?: $this->codec;
|
||||
|
||||
if (! self::is64BitSystem()) {
|
||||
return new SmallIntUuid($fields, $this->getConverter(), $codec);
|
||||
return new DegradedUuid($fields, $this->getConverter(), $codec);
|
||||
}
|
||||
|
||||
return new Uuid($fields, $this->getConverter(), $codec);
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Rhumsaa\Uuid;
|
||||
|
||||
class DegradedNumberConverterTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @expectedException Rhumsaa\Uuid\Exception\UnsatisfiedDependencyException
|
||||
*/
|
||||
public function testConvertingFromHexThrowsException()
|
||||
{
|
||||
$converter = new DegradedNumberConverter();
|
||||
|
||||
$converter->fromHex('ffff');
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException Rhumsaa\Uuid\Exception\UnsatisfiedDependencyException
|
||||
*/
|
||||
public function testConvertingToHexThrowsException()
|
||||
{
|
||||
$converter = new DegradedNumberConverter();
|
||||
|
||||
$converter->toHex(0);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Rhumsaa\Uuid;
|
||||
|
||||
class UnsatisfiedNumberConverterTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @expectedException Rhumsaa\Uuid\Exception\UnsatisfiedDependencyException
|
||||
*/
|
||||
public function testConverterThrowsException()
|
||||
{
|
||||
$converter = new UnsatisfiedNumberConverter();
|
||||
|
||||
$converter->fromHex('ffff');
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -185,8 +185,8 @@ class UuidTest extends TestCase
|
||||
|
||||
$uuid = Uuid::fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66');
|
||||
|
||||
$this->assertInstanceOf('Rhumsaa\Uuid\SmallIntUuid', $uuid);
|
||||
$this->assertInstanceOf('Rhumsaa\Uuid\UnsatisfiedNumberConverter', $uuid->getConverter());
|
||||
$this->assertInstanceOf('Rhumsaa\Uuid\DegradedUuid', $uuid);
|
||||
$this->assertInstanceOf('Rhumsaa\Uuid\DegradedNumberConverter', $uuid->getConverter());
|
||||
|
||||
$date = $uuid->getDateTime();
|
||||
}
|
||||
@@ -1675,7 +1675,7 @@ class UuidTest extends TestCase
|
||||
|
||||
/**
|
||||
* @expectedException Rhumsaa\Uuid\Exception\UnsatisfiedDependencyException
|
||||
* @expectedExceptionMessage Cannot call Rhumsaa\Uuid\UnsatisfiedNumberConverter::fromHex without support for large integers
|
||||
* @expectedExceptionMessage Cannot call Rhumsaa\Uuid\DegradedNumberConverter::fromHex without support for large integers
|
||||
*/
|
||||
public function testGetInteger()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user