mirror of
https://github.com/ramsey/uuid.git
synced 2026-06-15 16:07:55 +03:00
Accept Type\Hexadecimal for the first parameter to uuid1()
This commit is contained in:
@@ -20,6 +20,7 @@ use Ramsey\Uuid\Exception\RandomSourceException;
|
||||
use Ramsey\Uuid\Exception\TimeSourceException;
|
||||
use Ramsey\Uuid\Provider\NodeProviderInterface;
|
||||
use Ramsey\Uuid\Provider\TimeProviderInterface;
|
||||
use Ramsey\Uuid\Type\Hexadecimal;
|
||||
use Throwable;
|
||||
|
||||
use function ctype_xdigit;
|
||||
@@ -72,6 +73,10 @@ class DefaultTimeGenerator implements TimeGeneratorInterface
|
||||
*/
|
||||
public function generate($node = null, ?int $clockSeq = null): string
|
||||
{
|
||||
if ($node instanceof Hexadecimal) {
|
||||
$node = $node->toString();
|
||||
}
|
||||
|
||||
$node = $this->getValidNode($node);
|
||||
|
||||
if ($clockSeq === null) {
|
||||
|
||||
Reference in New Issue
Block a user