8000 [Uid] Clarify the format returned by getTime() · christingruber/symfony@c14c737 · GitHub
[go: up one dir, main page]

Skip to content

Commit c14c737

Browse files
committed
[Uid] Clarify the format returned by getTime()
1 parent b4ec36f commit c14c737

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

src/Symfony/Component/Uid/Ulid.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ public function toBase32(): string
104104
return $this->uid;
105105
}
106106

107+
/**
108+
* @return float Seconds since the Unix epoch 1970-01-01 00:00:00
109+
*/
107110
public function getTime(): float
108111
{
109112
$time = strtr(substr($this->uid, 0, 10), 'ABCDEFGHJKMNPQRSTVWXYZ', 'abcdefghijklmnopqrstuv');

src/Symfony/Component/Uid/UuidV1.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ public function __construct(string $uuid = null)
3131
}
3232
}
3333

34+
/**
35+
* @return float Seconds since the Unix epoch 1970-01-01 00:00:00
36+
*/
3437
public function getTime(): float
3538
{
3639
$time = '0'.substr($this->uid, 15, 3).substr($this->uid, 9, 4).substr($this->uid, 0, 8);

src/Symfony/Component/Uid/UuidV6.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ public function __construct(string $uuid = null)
3232
}
3333
}
3434

35+
/**
36+
* @return float Seconds since the Unix epoch 1970-01-01 00:00:00
37+
*/
3538
public function getTime(): float
3639
{
3740
$time = '0'.substr($this->uid, 0, 8).substr($this->uid, 9, 4).substr($this->uid, 15, 3);

0 commit comments

Comments
 (0)
0