src/ParameterParser/ParameterParser.php
private function parseSingle(&$i, $parameter, &$results)
    {
        if ($this->prefixExists($parameter)) {
            $closure = $this->getClosure($parameter);

            if ($closure != null) {
                $prefix = $this->getPrefix($parameter);
                $closure_arguments = [];
                $rFunction = new ReflectionFunction($closure);
                if ($rFunction->isVariadic()) {
                    $this->parseVariadicParameter(
                        $i,
                        $results,
                        $closure,
                        $closure_arguments,
                        $prefix,
                        $parameter
                    );
                } else {
                    $this->parseUniadicParameter(
                        $i,
                        $results,
                        $closure,
                        $closure_arguments,
                        $prefix,
                        $parameter,
                        $rFunction
                    );
                }

                $result_key = $this->getRealName($parameter);
                $result = $results[$result_key];

                if (! $result instanceof ParameterResult) {
                    if ($result == self::HALT_PARSE) {
                        $this->haltedBy = $this->getParameterClosure($parameter);
                        unset($results[$result_key]);

                        return false;
                    }
                } else {
                    if ($result->shouldHalt()) {
                        $this->haltedBy = $this->getParameterClosure($parameter);
                        if ($result->isHaltOnly()) {
                            unset($results[$result_key]);
                        } else {
                            $results[$result_key] = $result->getValue();
                        }

                        return false;
                    }
                }
            } else {
                $this->respondDefault($i, $results, $parameter);
            }
        } else {
            $this->respondDefault($i, $results, $parameter);
        }

        return true;
    }
private function parseSingle(&$i, $parameter, &$results)
    {
        if ($this->prefixExists($parameter)) {
            $closure = $this->getClosure($parameter);

            if ($closure != null) {
                $prefix = $this->getPrefix($parameter);
                $closure_arguments = [];
                $rFunction = new ReflectionFunction($closure);
                if ($rFunction->isVariadic()) {
                    $this->parseVariadicParameter(
                        $i,
                        $results,
                        $closure,
                        $closure_arguments,
                        $prefix,
                        $parameter
                    );
                } else {
                    $this->parseUniadicParameter(
                        $i,
                        $results,
                        $closure,
                        $closure_arguments,
                        $prefix,
                        $parameter,
                        $rFunction
                    );
                }

                $result_key = $this->getRealName($parameter);
                $result = $results[$result_key];

                if (! $result instanceof ParameterResult) {
                    if ($result == self::HALT_PARSE) {
                        $this->haltedBy = $this->getParameterClosure($parameter);
                        unset($results[$result_key]);

                        return false;
                    }
                } else {
                    if ($result->shouldHalt()) {
                        $this->haltedBy = $this->getParameterClosure($parameter);
                        if ($result->isHaltOnly()) {
                            unset($results[$result_key]);
                        } else {
                            $results[$result_key] = $result->getValue();
                        }

                        return false;
                    }
                }
            } else {
                $this->respondDefault($i, $results, $parameter);
            }
        } else {
            $this->respondDefault($i, $results, $parameter);
        }

        return true;
    }
private function parseSingle ( & $ i , $ parameter , & $ results ) { if ( $ this -> prefixExists ( $ parameter ) ) { $ closure = $ this -> getClosure ( $ parameter ) ; if ( $ closure != null ) { $ prefix = $ this -> getPrefix ( $ parameter ) ; $ closure_arguments = [ ] ; $ rFunction = new ReflectionFunction ( $ closure ) ; if ( $ rFunction -> isVariadic ( ) ) { $ this -> parseVariadicParameter ( $ i , $ results , $ closure , $ closure_arguments , $ prefix , $ parameter ) ; } else { $ this -> parseUniadicParameter ( $ i , $ results , $ closure , $ closure_arguments , $ prefix , $ parameter , $ rFunction ) ; } $ result_key = $ this -> getRealName ( $ parameter ) ; $ result = $ results [ $ result_key ] ; if ( ! $ result instanceof ParameterResult ) { if ( $ result == self :: HALT_PARSE ) { $ this -> haltedBy = $ this -> getParameterClosure ( $ parameter ) ; unset ( $ results [ $ result_key ] ) ; return false ; } } else { if ( $ result -> shouldHalt ( ) ) { $ this -> haltedBy = $ this -> getParameterClosure ( $ parameter ) ; if ( $ result -> isHaltOnly ( ) ) { unset ( $ results [ $ result_key ] ) ; } else { $ results [ $ result_key ] = $ result -> getValue ( ) ; } return false ; } } } else { $ this -> respondDefault ( $ i , $ results , $ parameter ) ; } } else { $ this -> respondDefault ( $ i , $ results , $ parameter ) ; } return true ; }
Parse a single parameter and increment the parser.

If this function returns 'false', it means that
the parse was halted by one of the parameters.

@param int    &$i
@param string  $parameter
@param array  &$results

@return bool
Parse a single parameter and increment the parser .