src/GameOfLife/Inputs/BoardEditor/OptionHandler/BoardEditorOptionParser.php
/**
     * Returns whether the input string is one of the registered options.
     *
     * @param String $_input Input string
     *
     * @return array|bool The option data (name, arguments) or false
     */
Returns whether the input string is one of the registered options.
@param String $_input Input string

@return array|bool The option data (name, arguments) or false
Returns whether the input string is one of the registered options . @param String $_input Input string @return array|bool The option data ( name arguments ) or false
private function isOption(String $_input)
    {
        $optionData = $this->splitOption($_input, " ");
        $options = $this->parentOptionHandler->options();
        if (stristr($_input, ",") && is_numeric(substr($optionData["name"], 0, 1)))
        {
            $optionData = $this->splitOption("toggle," . $_input, ",");
            return $optionData;
        }
        else
        {
            foreach ($options as $optionName => $option)
            {
                if (strtolower($option->name()) == strtolower($optionData["name"]) ||
                    $option->hasAlias($optionData["name"]))
                {
                    $optionData["name"] = $optionName;
                    return $optionData;
                }
            }
            return false;
        }
    }
private function isOption ( String $ _input ) { $ optionData = $ this -> splitOption ( $ _input , " " ) ; $ options = $ this -> parentOptionHandler -> options ( ) ; if ( stristr ( $ _input , " , " ) && is_numeric ( substr ( $ optionData [ " name " ] , 0 , 1 ) ) ) { $ optionData = $ this -> splitOption ( " toggle, " . $ _input , " , " ) ; return $ optionData ; } else { foreach ( $ options as $ optionName => $ option ) { if ( strtolower ( $ option -> name ( ) ) == strtolower ( $ optionData [ " name " ] ) || $ option -> hasAlias ( $ optionData [ " name " ] ) ) { $ optionData [ " name " ] = $ optionName ; return $ optionData ; } } return false ; } }
Returns whether the input string is one of the registered options.
Returns whether the input string is one of the registered options .