Skip to content

Commit a387b1d

Browse files
committed
[Uid][Serializer][Validator] Mention RFC 9562
1 parent fea8f98 commit a387b1d

File tree

6 files changed

+10
-8
lines changed

6 files changed

+10
-8
lines changed

src/Symfony/Component/Serializer/Normalizer/UidNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ final class UidNormalizer implements NormalizerInterface, DenormalizerInterface,
2424
public const NORMALIZATION_FORMAT_CANONICAL = 'canonical';
2525
public const NORMALIZATION_FORMAT_BASE58 = 'base58';
2626
public const NORMALIZATION_FORMAT_BASE32 = 'base32';
27-
public const NORMALIZATION_FORMAT_RFC4122 = 'rfc4122';
27+
public const NORMALIZATION_FORMAT_RFC4122 = 'rfc4122'; // RFC 9562 obsoleted RFC 4122 but the format is the same
2828

2929
private $defaultContext = [
3030
self::NORMALIZATION_FORMAT_KEY => self::NORMALIZATION_FORMAT_CANONICAL,

src/Symfony/Component/Uid/AbstractUid.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ public static function fromBase32(string $uid): self
7878
}
7979

8080
/**
81+
* @param string $uid A valid RFC 9562/4122 uid
82+
*
8183
* @return static
8284
*
8385
* @throws \InvalidArgumentException When the passed value is not valid
@@ -124,7 +126,7 @@ public function toBase32(): string
124126
}
125127

126128
/**
127-
* Returns the identifier as a RFC4122 case insensitive string.
129+
* Returns the identifier as a RFC 9562/4122 case insensitive string.
128130
*/
129131
public function toRfc4122(): string
130132
{

src/Symfony/Component/Uid/BinaryUtil.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class BinaryUtil
3636
'u' => 52, 'v' => 53, 'w' => 54, 'x' => 55, 'y' => 56, 'z' => 57,
3737
];
3838

39-
// https://tools.ietf.org/html/rfc4122#section-4.1.4
39+
// https://datatracker.ietf.org/doc/html/rfc9562#section-5.1
4040
// 0x01b21dd213814000 is the number of 100-ns intervals between the
4141
// UUID epoch 1582-10-15 00:00:00 and the Unix epoch 1970-01-01 00:00:00.
4242
private const TIME_OFFSET_INT = 0x01B21DD213814000;

src/Symfony/Component/Uid/Uuid.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
/**
1515
* @author Grégoire Pineau <lyrixx@lyrixx.info>
1616
*
17-
* @see https://tools.ietf.org/html/rfc4122#appendix-C for details about namespaces
17+
* @see https://datatracker.ietf.org/doc/html/rfc9562/#section-6.6 for details about namespaces
1818
*/
1919
class Uuid extends AbstractUid
2020
{

src/Symfony/Component/Validator/Constraints/Uuid.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class Uuid extends Constraint
3939
self::INVALID_VARIANT_ERROR => 'INVALID_VARIANT_ERROR',
4040
];
4141

42-
// Possible versions defined by RFC 4122
42+
// Possible versions defined by RFC 9562/4122
4343
public const V1_MAC = 1;
4444
public const V2_DCE = 2;
4545
public const V3_MD5 = 3;
@@ -64,7 +64,7 @@ class Uuid extends Constraint
6464
public $message = 'This is not a valid UUID.';
6565

6666
/**
67-
* Strict mode only allows UUIDs that meet the formal definition and formatting per RFC 4122.
67+
* Strict mode only allows UUIDs that meet the formal definition and formatting per RFC 9562/4122.
6868
*
6969
* Set this to `false` to allow legacy formats with different dash positioning or wrapping characters
7070
*

src/Symfony/Component/Validator/Constraints/UuidValidator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
/**
2020
* Validates whether the value is a valid UUID (also known as GUID).
2121
*
22-
* Strict validation will allow a UUID as specified per RFC 4122.
22+
* Strict validation will allow a UUID as specified per RFC 9562/4122.
2323
* Loose validation will allow any type of UUID.
2424
*
2525
* @author Colin O'Dell <colinodell@gmail.com>
2626
* @author Bernhard Schussek <bschussek@gmail.com>
2727
*
28-
* @see http://tools.ietf.org/html/rfc4122
28+
* @see https://datatracker.ietf.org/doc/html/rfc9562
2929
* @see https://en.wikipedia.org/wiki/Universally_unique_identifier
3030
*/
3131
class UuidValidator extends ConstraintValidator

0 commit comments

Comments
 (0)