public static function fromName($name)
    {
        $names = static::getNames();
        if (array_key_exists($name, $names)) {
            return new static($name, $names[$name]);
        }
        throw new \InvalidArgumentException("No enum constant '$name' in class " . get_called_class());
    }
public static function fromName($name)
    {
        $names = static::getNames();
        if (array_key_exists($name, $names)) {
            return new static($name, $names[$name]);
        }
        throw new \InvalidArgumentException("No enum constant '$name' in class " . get_called_class());
    }
public static function fromName ( $ name ) { $ names = static :: getNames ( ) ; if ( array_key_exists ( $ name , $ names ) ) { return new static ( $ name , $ names [ $ name ] ) ; } throw new \ InvalidArgumentException ( "No enum constant '$name' in class " . get_called_class ( ) ) ; }
Gets the enum instance for the name

@return Enum
Gets the enum instance for the name