mirror of
https://codeberg.org/vlw/php-xenum.git
synced 2025-09-13 20:23:41 +02:00
fix: use global namespace for ValueError
(#5)
Fixes exception: ``` Error: Class "vlw\ValueError" not found ``` Reviewed-on: https://codeberg.org/vlw/php-xenum/pulls/5
This commit is contained in:
parent
1c997a5574
commit
ba3f43a9e2
1 changed files with 2 additions and 2 deletions
|
@ -23,7 +23,7 @@
|
||||||
// Throw a ValueError if Enum name is not found
|
// Throw a ValueError if Enum name is not found
|
||||||
public static function fromName(?string $name): static {
|
public static function fromName(?string $name): static {
|
||||||
$case = self::tryFromName($name);
|
$case = self::tryFromName($name);
|
||||||
return $case ? $case : throw new ValueError("'{$name}' is not a valid case for enum " . self::class);
|
return $case ? $case : throw new \ValueError("'{$name}' is not a valid case for enum " . self::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return array of enum names
|
// Return array of enum names
|
||||||
|
|
Loading…
Add table
Reference in a new issue