mirror of
https://codeberg.org/vlw/php-xenum.git
synced 2025-09-13 12:13:42 +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
|
||||
public static function fromName(?string $name): static {
|
||||
$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
|
||||
|
@ -40,4 +40,4 @@
|
|||
public static function entries(): array {
|
||||
return array_combine(self::names(), self::values());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue