Obtain the parameter with the given name from the input provider if it exists.

@param InputProviderInterface $input The input provider.
@param string                 $name  The parameter to retrieve.

@return ModelId|null
187057
private function modelIdFromParameter(InputProviderInterface $input, $name)
    {
        if ($input->hasParameter($name) && ($value = $input->getParameter($name))) {
            return ModelId::fromSerialized($value);
        }

        return null;
    }
1151387
protected function findInputValueByName( $name, $inputArray )
    {
        foreach($inputArray as $key=>$value){
            if($key === $name) { // use === because plain == allowed numeric indexes to be equal to names
                return $value;
            }
            if (is_array($value)) {
                if (($result = $this->findInputValueByName($name,$value)) !== false) {
                    return $result;
                }
            }
        }

        return false;
    }
59924
public function get(string $name = null)
    {
        return $this->requestParser->parseInto(
                $this->injector->getInstance(
                        $this->userInputClass,
                        'stubbles.console.input.instance'
                ),
                $name
        );
    }
1285989
protected function getCommand($input)
    {
        $input = new StringInput($input);
        if ($name = $input->getFirstArgument()) {
            return $this->get($name);
        }
    }
472889
protected function getConverter(InputInterface $input)
    {
        return $this->getConverterFactory()->get($input->getOption('input-format'), $this->output_format);
    }
309055
protected function getStatsd(InputInterface $input)
    {
        if (null === $this->statsd) {
            $this->statsdConnection = new UdpSocket(
                $input->getOption('statsd-host'),
                $input->getOption('statsd-port')
            );
            $this->statsd = new Client(
                $this->statsdConnection,
                $input->getOption('statsd-namespace')
            );
        }

        return $this->statsd;
    }
1326705
public function getParam ($name)
		{
			if (isset( $this->_params[ $name ] ))
				return $this->_params[ $name ];
			else
				return null;
		}
89257
public function getResolvedArtisanCommand(InputInterface $input = null) {
        $name = $this->getCommandName($input);
        try {
            $command = $this->find($name);
        } catch (Exception $e) {
            EventLog::logError('command.notFound', $e, ['name' => $name]);
            return null;
        }
        return $command;
    }
570699
public function dataProvider(string $name): DataProviderInterface
    {
        if (isset($this->dataProviders[$name])) {
            return $this->dataProviders[$name];
        }
        throw new \InvalidArgumentException(sprintf(
            "Requested data provider '%s' could not be found; does the content type exist, or provider not specified?",
            $name
        ));
    }
671123
public function getFunction(string $name): ?FunctionModelInterface
    {
        $functions = $this->functions->filter(function (FunctionModelInterface $function) use ($name) {
            return $function->getName() === $name;
        });
        if ($functions->isEmpty()) {
            return null;
        }
        return $functions->first();
    }
98449
protected function getInputFilterByName(ServiceLocatorInterface $serviceLocator, $name)
    {
        if ($serviceLocator->has('InputFilterManager')) {
            $serviceLocator = $serviceLocator->get('InputFilterManager');
        }

        $obj = $serviceLocator->get($name);
        if (!$obj instanceof InputFilterInterface) {
            throw new Exception\RuntimeException(sprintf(
                'Instance of type %s is invalid; must implement %s',
                (is_object($obj) ? get_class($obj) : gettype($obj)),
                InputFilterInterface::class
            ));
        }
        return $obj;
    }
1049009
protected function getForeignModelFromRequest($name)
    {
        $this->checkForeignModelFromRequest($name);
        $requestKey = $this->getRequestKeyFromString($name);

        return $this->getRequest()->attributes->get($requestKey);
    }
684977
public function parameter(string $name): ?string
    {
        if (isset($this->parameters[$name])) {
            return $this->parameters[$name];
        }

        return null;
    }
1273519
private function filterModel(Input $input)
    {
        $models = array_filter(
            $this->findAllModels(),
            function (CommandInterface $command) use ($input) {
                return preg_match(preg_quote($command->getCmd()), $input->text);
            }
        );

        if (empty($models)) {
            return null;
        }

        return $models[0];
    }
140203
public static function getPutParameter(string $name, string $default = null, array $allowed = null): string
    {
        return self::get('PUT', $name, $default, $allowed);
    }
586213
public function getParameter($name)
    {
        if (!array_key_exists($name, $this->parameters)) {
            throw new InvalidArgumentException(sprintf('Parameter: "%s" does not exist', $name));
        }

        return $this->parameters[$name];
    }
1031701
public function getIntParam($name, $default = null, $optional = false)
    {
        $value = $this->getParam($name, $default, $optional);
        if ($value !== null) {
            if (!preg_match('/^\-?\d*$/', $value)) {
                throw new InvalidParameterException("Parameter '{$name}' is invalid");
            }
            $value = (int)$value;
        }
        return $value;
    }