public function getArgument($name, $includeBase = true)
    {
        if (!is_int($name)) {
            Assert::string($name, 'The argument name must be a string or integer. Got: %s');
            Assert::notEmpty($name, 'The argument name must not be empty.');
        }

        Assert::boolean($includeBase, 'The parameter $includeBase must be a boolean. Got: %s');

        if (is_int($name)) {
            $arguments = array_values($this->getArguments($includeBase));

            if (!isset($arguments[$name])) {
                throw NoSuchArgumentException::forPosition($name);
            }
        } else {
            $arguments = $this->getArguments($includeBase);

            if (!isset($arguments[$name])) {
                throw NoSuchArgumentException::forArgumentName($name);
            }
        }

        return $arguments[$name];
    }
public function getArgument($name, $includeBase = true)
    {
        if (!is_int($name)) {
            Assert::string($name, 'The argument name must be a string or integer. Got: %s');
            Assert::notEmpty($name, 'The argument name must not be empty.');
        }

        Assert::boolean($includeBase, 'The parameter $includeBase must be a boolean. Got: %s');

        if (is_int($name)) {
            $arguments = array_values($this->getArguments($includeBase));

            if (!isset($arguments[$name])) {
                throw NoSuchArgumentException::forPosition($name);
            }
        } else {
            $arguments = $this->getArguments($includeBase);

            if (!isset($arguments[$name])) {
                throw NoSuchArgumentException::forArgumentName($name);
            }
        }

        return $arguments[$name];
    }
public function getArgument ( $ name , $ includeBase = true ) { if ( ! is_int ( $ name ) ) { Assert :: string ( $ name , 'The argument name must be a string or integer. Got: %s' ) ; Assert :: notEmpty ( $ name , 'The argument name must not be empty.' ) ; } Assert :: boolean ( $ includeBase , 'The parameter $includeBase must be a boolean. Got: %s' ) ; if ( is_int ( $ name ) ) { $ arguments = array_values ( $ this -> getArguments ( $ includeBase ) ) ; if ( ! isset ( $ arguments [ $ name ] ) ) { throw NoSuchArgumentException :: forPosition ( $ name ) ; } } else { $ arguments = $ this -> getArguments ( $ includeBase ) ; if ( ! isset ( $ arguments [ $ name ] ) ) { throw NoSuchArgumentException :: forArgumentName ( $ name ) ; } } return $ arguments [ $ name ] ; }
Returns an argument by its name or position.

You can either pass the name of the argument or the 0-based position of
the argument.

@param string|int $name        The argument name or its 0-based position
in the argument list.
@param bool       $includeBase Whether to include arguments in the base
format in the search.

@return Argument The argument.

@throws NoSuchArgumentException If the argument with the given name or
position does not exist.
Returns an argument by its name or position .