Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fb69394

Browse filesBrowse files
minor #58238 [Serializer][Uid][Validator] Mention RFC 9562 (fancyweb)
This PR was merged into the 5.4 branch. Discussion ---------- [Serializer][Uid][Validator] Mention RFC 9562 | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT RFC 4122 has been obsoleted by RFC 9562 since May 2024. The format remains the same so we don't need to do anything. Renaming everything with BC would certainly be a waste of time. However, we can add some comments and update the links to be up-to-date. Commits ------- a387b1d [Uid][Serializer][Validator] Mention RFC 9562
2 parents a0673bc + a387b1d commit fb69394
Copy full SHA for fb69394

File tree

6 files changed

+10
-8
lines changed
Filter options

6 files changed

+10
-8
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Serializer/Normalizer/UidNormalizer.php
+1-1Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Uid/AbstractUid.php
+3-1Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Uid/BinaryUtil.php
+1-1Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Uid/Uuid.php
+1-1Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/Uuid.php
+2-2Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/UuidValidator.php
+2-2Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.