Compare commits

..

No commits in common. "master" and "1.1.2" have entirely different histories.

View file

@ -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
@ -40,4 +40,4 @@
public static function entries(): array { public static function entries(): array {
return array_combine(self::names(), self::values()); return array_combine(self::names(), self::values());
} }
} }