mirror of
https://github.com/ramsey/uuid.git
synced 2026-06-18 16:37:43 +03:00
Remove deprecated Uuid::VALID_PATTERN constant
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
@@ -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],
|
||||
|
||||
Reference in New Issue
Block a user