Add existing v7 and v8 factory methods to the interface

This commit is contained in:
MGatner
2025-08-10 08:26:21 -04:00
parent de9bead614
commit 08deeb160f
+27
View File
@@ -154,4 +154,31 @@ interface UuidFactoryInterface
* @return UuidInterface A UuidInterface instance that represents a version 6 UUID
*/
public function uuid6(?Hexadecimal $node = null, ?int $clockSeq = null): UuidInterface;
/**
* Returns a version 7 (Unix Epoch time) UUID
*
* @param DateTimeInterface | null $dateTime An optional date/time from which to create the version 7 UUID. If not
* provided, the UUID is generated using the current date/time.
*
* @return UuidInterface A UuidInterface instance that represents a version 7 UUID
*/
public function uuid7(?DateTimeInterface $dateTime = null): UuidInterface;
/**
* Returns a version 8 (custom format) UUID
*
* The bytes provided may contain any value according to your application's needs. Be aware, however, that other
* applications may not understand the semantics of the value.
*
* @param non-empty-string $bytes A 16-byte octet string. This is an open blob of data that you may fill with 128
* bits of information. Be aware, however, bits 48 through 51 will be replaced with the UUID version field, and
* bits 64 and 65 will be replaced with the UUID variant. You MUST NOT rely on these bits for your application
* needs.
*
* @return UuidInterface A UuidInterface instance that represents a version 8 UUID
*
* @pure
*/
public function uuid8(string $bytes): UuidInterface;
}