src/Enum.php
protected function buildClass($name)
    {
        $className = $this->formatClassName($name);

        if (!class_exists($className)) {
            throw new RuntimeException('Enum '.$className.' is not exists');
        }

        $enum = new $className();
        if (!$enum instanceof Enumable) {
            throw new RuntimeException('Enum '.$className.' is not instance of '.Enumable::class);
        }

        return $enum;
    }
protected function buildClass($name)
    {
        $className = $this->formatClassName($name);

        if (!class_exists($className)) {
            throw new RuntimeException('Enum '.$className.' is not exists');
        }

        $enum = new $className();
        if (!$enum instanceof Enumable) {
            throw new RuntimeException('Enum '.$className.' is not instance of '.Enumable::class);
        }

        return $enum;
    }
protected function buildClass ( $ name ) { $ className = $ this -> formatClassName ( $ name ) ; if ( ! class_exists ( $ className ) ) { throw new RuntimeException ( 'Enum ' . $ className . ' is not exists' ) ; } $ enum = new $ className ( ) ; if ( ! $ enum instanceof Enumable ) { throw new RuntimeException ( 'Enum ' . $ className . ' is not instance of ' . Enumable :: class ) ; } return $ enum ; }
Build a Enum class.

@param string $name

@throws RuntimeException

@return Enumable
Build a Enum class .