Rename degraded feature classes with more consistent names

This commit is contained in:
Thibaud Fabre
2014-11-06 10:42:02 +01:00
parent cd3e58b1f5
commit f97c9e08f9
6 changed files with 33 additions and 23 deletions
@@ -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
View File
@@ -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);
+26
View File
@@ -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);
}
}
-16
View File
@@ -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
View File
@@ -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()
{