diff --git a/Datatypes/Enum.php b/Datatypes/Enum.php index af47943df..6ca1c31c5 100644 --- a/Datatypes/Enum.php +++ b/Datatypes/Enum.php @@ -85,14 +85,14 @@ abstract class Enum * * @return mixed * - * @throws \Exception Throws this exception if the constant is not defined in the enum class. + * @throws \UnexpectedValueException Throws this exception if the constant is not defined in the enum class. * * @since 1.0.0 */ public static function getByName(string $name) { if (!self::isValidName($name)) { - throw new \Exception('Undefined constant "' . $name . '"'); + throw new \UnexpectedValueException($name); } return constant('static::' . $name); @@ -105,8 +105,6 @@ abstract class Enum * * @return mixed * - * @throws \Exception Throws this exception if the constant is not defined in the enum class. - * * @since 1.0.0 */ public static function getName(string $value)