Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Code formatting
  • Loading branch information
danielbeardsley committed Oct 29, 2020
commit facf0bfcb5944e299259aebddf50f4eb4dcf053d
3 changes: 2 additions & 1 deletion src/Enum.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ public static function __callStatic($name, $arguments)
if (!isset(self::$instances[$class][$name])) {
$array = static::toArray();
if (!isset($array[$name]) && !\array_key_exists($name, $array)) {
throw new \BadMethodCallException("No static method or enum constant '$name' in class " . static::class);
$message = "No static method or enum constant '$name' in class " . static::class;
throw new \BadMethodCallException($message);
}
return self::$instances[$class][$name] = new static($array[$name]);
}
Expand Down