Redaxscript\Console\Parser::_parseArgument PHP Method

_parseArgument() protected method

parse raw argument
Since: 3.0.0
protected _parseArgument ( array $argumentArray = [] )
$argumentArray array raw argument to be parsed
    protected function _parseArgument($argumentArray = [])
    {
        $skip = false;
        $argumentKey = 0;
        foreach ($argumentArray as $key => $value) {
            $next = next($argumentArray);
            if (substr($value, 0, 1) === '-') {
                $offset = substr($value, 0, 2) === '--' ? 2 : 1;
                $optionArray = $this->_parseOption($value, $next, $offset);
                $skip = $optionArray['value'] === $next;
                $this->setOption($optionArray['key'], $optionArray['value']);
            } else {
                if ($value && !$skip) {
                    $this->setArgument($argumentKey++, $value);
                }
            }
        }
    }