mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
feat: toBeUUID expectation
This commit is contained in:
@ -92,4 +92,12 @@ final class Str
|
||||
{
|
||||
return $search === '' ? $subject : array_reverse(explode($search, $subject, 2))[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if a given value is a valid UUID.
|
||||
*/
|
||||
public static function isUuid(string $value): bool
|
||||
{
|
||||
return preg_match('/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iD', $value) > 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user