Remove deprecated Uuid::VALID_PATTERN constant

This commit is contained in:
Ben Ramsey
2022-08-05 16:52:23 -05:00
parent 6e05ba7f42
commit b551e4645d
3 changed files with 7 additions and 8 deletions
+2
View File
@@ -51,6 +51,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
* `getTimestampHex()`
* `getVariant()`
* `getVersion()`
* Remove the following deprecated constants:
* `Ramsey\Uuid\Uuid::VALID_PATTERN`
* Remove dependency on ramsey/collection package.
-5
View File
@@ -80,11 +80,6 @@ class Uuid implements Rfc4122UuidInterface
*/
public const NIL = '00000000-0000-0000-0000-000000000000';
/**
* @deprecated Use {@see ValidatorInterface::getPattern()} instead.
*/
public const VALID_PATTERN = '^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$';
/**
* Version 1 (time-based) UUID
*
+5 -3
View File
@@ -549,12 +549,15 @@ class ExpectedBehaviorTest extends TestCase
/**
* @dataProvider provideUuidConstantTests
*/
public function testUuidConstants($constantName, $expected)
public function testUuidConstants(string $constantName, int | string $expected): void
{
$this->assertSame($expected, constant("Ramsey\\Uuid\\Uuid::{$constantName}"));
}
public function provideUuidConstantTests()
/**
* @return array<array{string, int | string}>
*/
public function provideUuidConstantTests(): array
{
return [
['NAMESPACE_DNS', '6ba7b810-9dad-11d1-80b4-00c04fd430c8'],
@@ -562,7 +565,6 @@ class ExpectedBehaviorTest extends TestCase
['NAMESPACE_OID', '6ba7b812-9dad-11d1-80b4-00c04fd430c8'],
['NAMESPACE_X500', '6ba7b814-9dad-11d1-80b4-00c04fd430c8'],
['NIL', '00000000-0000-0000-0000-000000000000'],
['VALID_PATTERN', '^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$'],
['UUID_TYPE_TIME', 1],
['UUID_TYPE_IDENTIFIER', 2],
['UUID_TYPE_HASH_MD5', 3],