mirror of
https://github.com/ramsey/uuid.git
synced 2026-06-26 17:46:38 +03:00
Marking Uuid::uuid5() as pure: same input leads to same output, and no I/O under normal operational constraints
This commit is contained in:
@@ -89,4 +89,13 @@ final class UuidIsImmutable
|
||||
Uuid::isValid('ff6f8cb0-c57d-11e1-9b21-0800200c9a66'),
|
||||
];
|
||||
}
|
||||
|
||||
/** @psalm-pure */
|
||||
public static function uuid5IsPure(): UuidInterface
|
||||
{
|
||||
return Uuid::uuid5(
|
||||
Uuid::fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66'),
|
||||
'Look ma! I am a pure function!'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user