This commit is contained in:
2025-05-12 14:25:25 +02:00
parent ab2db755ef
commit 9e378ca2b7
2719 changed files with 46505 additions and 60181 deletions

View File

@@ -24,7 +24,7 @@ class UuidV6 extends Uuid implements TimeBasedUidInterface
private static string $node;
public function __construct(string $uuid = null)
public function __construct(?string $uuid = null)
{
if (null === $uuid) {
$this->uid = static::generate();
@@ -43,7 +43,7 @@ class UuidV6 extends Uuid implements TimeBasedUidInterface
return substr($this->uid, 24);
}
public static function generate(\DateTimeInterface $time = null, Uuid $node = null): string
public static function generate(?\DateTimeInterface $time = null, ?Uuid $node = null): string
{
$uuidV1 = UuidV1::generate($time, $node);
$uuid = substr($uuidV1, 15, 3).substr($uuidV1, 9, 4).$uuidV1[0].'-'.substr($uuidV1, 1, 4).'-6'.substr($uuidV1, 5, 3).substr($uuidV1, 18, 6);