public static function createByName($name)
    {
        $constants = self::getConstantsByName();

        if (!array_key_exists($name, $constants)) {
            throw EnumException::invalidName(get_called_class(), $name);
        }

        return new static($constants[$name]);
    }