feat: add toBeUlid assertion and isUlid validation method (#1726)

This commit is contained in:
Sonali dudhia
2026-06-11 14:44:00 +05:30
committed by GitHub
parent 3d5bba93f8
commit 774a340400
3 changed files with 50 additions and 0 deletions
+8
View File
@@ -98,6 +98,14 @@ final class Str
return preg_match('/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iD', $value) > 0;
}
/**
* Determine if a given value is a valid ULID.
*/
public static function isUlid(string $value): bool
{
return preg_match('/^[0-9A-HJKMNP-TV-Z]{26}$/', $value) > 0;
}
/**
* Creates a describe block as `$describeDescription` → `$testDescription` format.
*