Gets an argument by name

@param string $name The name of the argument to get.

@return string The value of the argument.
483234
public function getArg($name = '')
    {
        if (!isset($this->parsedArgs[$name])) {
            throw new \PhpCli\Exception(self::ERR_NO_ARG_BY_NAME);
        }

        return $this->parsedArgs[$name];
    }
594961
public function getCommand($name)
    {
        if (!isset($this->commands[$name])) {
            throw new \InvalidArgumentException("Command '$name' does not exist");
        }
        return $this->commands[$name];
    }
234732
public function getArgument($name, $default = null) {
        try {
            $argument = $this->getCommand()->findArgument($name);
            $value = $argument->getValue();

            if ($value === null) {
                $value = $default;
            }

            return $value;
        } catch (ArgumentNotFoundException $ex) {}

        return $default;
    }
523588
public function getGet($name = null)
    {
        if ($name !== null) {
            return isset($this->getParams[$name]) ? $this->getParams[$name] : null;
        }

        return $this->getParams;
    }
557712
public function getValue(string $name): ?string
    {
        if (isset($this->data[$name])) {
            return $this->data[$name]->value;
        }
        return null;
    }
1080357
public function findArgument($name) {
        foreach ($this->getArguments() as $argument) {
            if ($argument->getName() === $name) {
                return $argument;
            }
        }

        throw new ArgumentNotFoundException(s(
            'Argument "%s" does not exist.',
            $name
        ));
    }
718037
public function getValue($name)
    {
        $value = null;
        if ($this->has($name)) {
            $value = call_user_func_array(
                [$this->_inputs[$name], 'getValue'],
                [$name]
            );
        }
        return $value;
    }
962990
public function getArg(string $name)
    {
        if (!is_array($this->args)) {
            throw new \LogicException(sprintf("Ask for arg '%s' before the router init is finished", $name));
        }

        return $this->args[$name] ?? null;
    }
549722
public function getValue($name)
    {
        return (isset($this->options['params'][$name])) ? $this->options['params'][$name] : null;
    }
637750
public function argument($name)
    {
        $input = $this->getInput();

        return (is_null($name)) ? $input->getArguments() : $input->getArgument($name);
    }
714027
public static function get($name)
    {
        if (isset($_REQUEST[$name])) {
            return $_REQUEST[$name];
        }

        if (isset($_GET[$name])) {
            return $_GET[$name];
        }

        return;
    }
1293724
protected function getArg ($name)
	{
		
		// Work out which request arguments to use based on the request method
		
		switch ($this->action)
		{
			
			case 'get';
			case 'put':
				return $this->getURLArg ($name);
				break;
			
			case 'post';
			case 'delete':
				return $this->getPostArg ($name);
				break;
			
			default:
				return parent::getArg ($name);
				break;
			
		}
		
	}
356119
public function get(string $name)
    {
        if ($this->has($name)) {
            return $this->values[$name];
        } else {
            return $this->throwNotFound($name);
        }
    }
1086432
public static function getByName($name)
    {
        $name = (string)$name;
        $class = get_called_class();
        if (isset(self::$instances[$class][$name])) {
            return self::$instances[$class][$name];
        }
        $const = $class . '::' . $name;
        if (!defined($const)) {
            throw new \InvalidArgumentException($const . ' not defined');
        }
        return self::$instances[$class][$name] = new $class(constant($const));
    }
1252224
public function get($name)
    {
        $input = null;
        if ($this->has($name)) {
            $input = $this->_inputs[$name];
        }
        return $input;
    }
744891
public function get(string $name)
    {
        $name = $this->getDefinitiveName($name);

        if (!$this->has($name)) {
            $instance = $this->build($name);
            $this->store($instance);
        }

        return $this->instances[$name];
    }
752096
public function get($name)
    {
        $name = ltrim($name, '\\');
        if (! isset($this->instances[$name])) {
            $this->instances[$name] = $this->newInstance($name);
        }
        return $this->instances[$name];
    }