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 aed93cd

Browse filesBrowse files
committed
minor #36064 [Uid] remove Uuid::getVariant() (nicolas-grekas)
This PR was merged into the 5.1-dev branch. Discussion ---------- [Uid] remove Uuid::getVariant() | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Let's simplify the API. One less concept to grasp. I think there are no use cases for variants in modern tech, check: https://en.wikipedia.org/wiki/Universally_unique_identifier#Variants Commits ------- 49efe9a [Uid] remove Uuid::getVariant()
2 parents cc73b1e + 49efe9a commit aed93cd
Copy full SHA for aed93cd

2 files changed

-11Lines changed: 0 additions & 11 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/Symfony/Component/Uid/Tests/UuidTest.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Component/Uid/Tests/UuidTest.php
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ public function testExtraMethods()
132132
{
133133
$uuid = new Uuid(self::A_UUID_V1);
134134

135-
$this->assertSame(Uuid::VARIANT_DCE, $uuid->getVariant());
136135
$this->assertSame(1583245966.746458, $uuid->getTime());
137136
$this->assertSame('3499710062d0', $uuid->getMac());
138137
$this->assertSame(self::A_UUID_V1, (string) $uuid);
Collapse file

‎src/Symfony/Component/Uid/Uuid.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Component/Uid/Uuid.php
-10Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@ class Uuid implements \JsonSerializable
2323
public const TYPE_4 = UUID_TYPE_RANDOM;
2424
public const TYPE_5 = UUID_TYPE_SHA1;
2525

26-
public const VARIANT_NCS = UUID_VARIANT_NCS;
27-
public const VARIANT_DCE = UUID_VARIANT_DCE;
28-
public const VARIANT_MICROSOFT = UUID_VARIANT_MICROSOFT;
29-
public const VARIANT_OTHER = UUID_VARIANT_OTHER;
30-
3126
// https://tools.ietf.org/html/rfc4122#section-4.1.4
3227
// 0x01b21dd213814000 is the number of 100-ns intervals between the
3328
// UUID epoch 1582-10-15 00:00:00 and the Unix epoch 1970-01-01 00:00:00.
@@ -113,11 +108,6 @@ public function getType(): int
113108
return uuid_type($this->uuid);
114109
}
115110

116-
public function getVariant(): int
117-
{
118-
return uuid_variant($this->uuid);
119-
}
120-
121111
public function getTime(): float
122112
{
123113
if (self::TYPE_1 !== $t = uuid_type($this->uuid)) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.