diff --git a/CHANGELOG.md b/CHANGELOG.md index a395be4..9067e0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/src/Uuid.php b/src/Uuid.php index d17e0e6..a702e44 100644 --- a/src/Uuid.php +++ b/src/Uuid.php @@ -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 * diff --git a/tests/ExpectedBehaviorTest.php b/tests/ExpectedBehaviorTest.php index 4b360dc..002650e 100644 --- a/tests/ExpectedBehaviorTest.php +++ b/tests/ExpectedBehaviorTest.php @@ -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 + */ + 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],