Skip to content

Commit ddba89a

Browse files
committed
- wants to throw an exception for assert()
1 parent 5441639 commit ddba89a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

UUID.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Koded\Stdlib;
1313

14+
use AssertionError;
1415
use InvalidArgumentException;
1516
use function chr;
1617
use function ctype_digit;
@@ -151,7 +152,7 @@ public static function valid(string $uuid): bool
151152
*/
152153
public static function matches(string $uuid, int $version = 4): bool
153154
{
154-
assert(in_array($version, [1, 3, 4, 5]), "Expected UUID version 1, 3, 4 or 5 (got $version)");
155+
assert(in_array($version, [1, 3, 4, 5]), new AssertionError("Expected UUID version 1, 3, 4 or 5 (got $version)"));
155156
return UUID::valid($uuid);
156157
}
157158

0 commit comments

Comments
 (0)