@param string $parameterName

@return InterfaceParameter
@throws InvalidArgumentException
@throws \SimplyCodedSoftware\Messaging\MessagingException
505285
public function getParameterWithName(string $parameterName): InterfaceParameter
    {
        foreach ($this->getInterfaceParameters() as $parameter) {
            if ($parameter->getName() == $parameterName) {
                return $parameter;
            }
        }

        throw InvalidArgumentException::create($this . " doesn't have parameter with name {$parameterName}");
    }
504086
public function getMoney($parameterName = 'amount')
    {
        $amount = $this->getParameter($parameterName);

        if ($amount instanceof Money) {
            return $amount;
        }

        if ($amount !== null) {
            $moneyParser = new DecimalMoneyParser($this->getCurrencies());
            $currencyCode = $this->getCurrency() ?: 'USD';
            $currency = new Currency($currencyCode);

            $number = Number::fromString($amount);

            // Check for rounding that may occur if too many significant decimal digits are supplied.
            $decimal_count = strlen($number->getFractionalPart());
            $subunit = $this->getCurrencies()->subunitFor($currency);
            if ($decimal_count > $subunit) {
                throw new InvalidRequestException('Amount precision is too high for currency.');
            }

            $money = $moneyParser->parse((string) $number, $currency->getCode());

            // Check for a negative amount.
            if (!$this->negativeAmountAllowed && $money->isNegative()) {
                throw new InvalidRequestException('A negative amount is not allowed.');
            }

            // Check for a zero amount.
            if (!$this->zeroAmountAllowed && $money->isZero()) {
                throw new InvalidRequestException('A zero amount is not allowed.');
            }

            return $money;
        }
    }
365702
private function resolveParameterName(
        ContainerBuilder $container,
        $parameterName
    ) {
        if (!is_string($parameterName)) {
            return $parameterName;
        }

        return $container->hasParameter($parameterName)
            ? $container->getParameter($parameterName)
            : $parameterName;
    }
1339323
public static function parse(string $hostname): HostnameInterface
    {
        if (!self::myParse($hostname, $domainParts, $tld, $error)) {
            throw new HostnameInvalidArgumentException($error);
        }

        return new self($domainParts, $tld);
    }
1136612
public function getModelDefinitionByFieldName($fieldName)
    {
        foreach ($this->fieldMappings as $mapping) {
            if (in_array($fieldName, $mapping->getFields())) {
                return $mapping;
            }
        }

        throw new \InvalidArgumentException(sprintf('%s does not exists in %s', $fieldName, $this->name));
    }
1321986
public function parameter($key, $value = NULL)
	{
		if (func_num_args() === 1)
		{
			if ( ! array_key_exists($key, $this->_parameters))
			{
				throw new \InvalidArgumentException('Parameter not set: '.$key);
			}
			return $this->_parameters[$key];
		}
		$this->_parameters[$key] = $value;
		return $this;
	}
536153
public function withQueryParameter(string $parameterName, $value): InternalRequest
    {
        $query = $this->modifyQueryParameter(
            $this->uri->getQuery() ?? '',
            $parameterName,
            $value
        );

        $target = clone $this;
        $target->uri = $target->uri->withQuery($query);
        return $target;
    }
1173328
protected static function getParameterValue(
        ContainerInterface $container,
        $param,
        int $index,
        array $map,
        bool $safe
    ) {
        if ($isReflection = ($param instanceof \ReflectionParameter)) {
            $name = $param->name;
        } elseif (\is_array($param)) {
            $name = $param['name'];
        } else {
            throw new \InvalidArgumentException('Parameter must be the instance of \ReflectionParameter or array');
        }

        if (\array_key_exists($name, $map)) {
            return $map[$name]; // // resolve as user-provided named argument
        }

        if (\array_key_exists($index, $map)) {
            return $map[$index]; // resolve as user-provided positional argument
        }

        $type = $isReflection ? static::getParameterType($param) : $param['type'];

        if ($type) {
            if (\array_key_exists($type, $map)) {
                return $map[$type]; // resolve as user-provided type-hinted argument
            }

            if ($container->has($type)) {
                return $container->get($type); // resolve as component registered by class/interface name
            }
        }

        if ($safe && $container->has($name)) {
            return $container->get($name); // resolve as component with matching parameter name
        }

        if ($isReflection) {
            if ($param->isOptional()) {
                return $param->getDefaultValue(); // unresolved, optional: resolve using default value
            }

            if ($type && $param->allowsNull()) {
                return null; // unresolved, type-hinted, nullable: resolve as NULL
            }

            $reflection = $param->getDeclaringFunction();
            $file = $reflection->getFileName();
            $line = $reflection->getStartLine();
        } elseif (\array_key_exists('default', $param)) {
            return $param['default'];
        } else {
            ['file' => $file, 'line' => $line] = $param;
        }

        // unresolved - throw a container exception:
        throw new \InvalidArgumentException(
            "Unable to resolve parameter: \${$name} " . ($type ? "({$type}) " : '') .
            'in file: ' . $file . ', line ' . $line
        );
    }
1280448
private function getArgumentByName(\ReflectionParameter $parameter, $parameters)
    {
        foreach ($parameters as $name => $item) {
            $paramName = $parameter->getName();
            if ($name === $paramName) {
                return $item;
            }
        }

        return null;
    }
684242
public function getParameter(string $parameterName)
    {
        if (!$this->hasParameter($parameterName)) {
            return null;
        }

        return $this->storage->offsetGet($parameterName);
    }
995872
protected function getSymfonyFormFromParams($params, $name, $throwException = false)
    {
        $sfForm = $this->getParam($params, $name);

        if (null === $sfForm && false === $throwException) {
            return null;
        }

        if (!$sfForm instanceof SymfonyForm) {
            throw new \InvalidArgumentException(
                sprintf(
                    "%s parameter must be an instance of " .
                    "\Symfony\Component\Form\Form, instance of %s found",
                    $name,
                    is_object($sfForm) ? get_class($sfForm) : gettype($sfForm)
                )
            );
        }

        return $sfForm;
    }
1301102
public static function create(string $parameterName, string $headerName, bool $isRequired) : self
    {
        return new self($parameterName, $headerName, $isRequired);
    }
57937
private function createParameterError(string $paramName, string $errorTitle): ErrorInterface
    {
        $source = [Error::SOURCE_PARAMETER => $paramName];
        $error  = new Error(null, null, null, null, null, $errorTitle, null, $source);

        return $error;
    }
466502
public function getType($typeName)
    {
        if (!isset($this->types[$typeName])) {
            throw new \InvalidArgumentException("Type $typeName does not exists in the index.");
        }

        return $this->types[$typeName];
    }
1236013
protected function getArrayPathParameter($parameterName, array $parameterValue)
    {
        $urlParameter = array();

        foreach ($parameterValue as $parameterValueValue) {
            $urlParameter[] = $this->getPathParameter($parameterName, $parameterValueValue);
        }

        return implode('&', $urlParameter);
    }
704004
protected function getClassNameByInterface($interfaceName)
    {
        if (array_key_exists($interfaceName, $this->interfaceNameToClassName)) {
            return $this->interfaceNameToClassName[$interfaceName];
        }

        if (0 === $this->countObjectManagers) {
            $this->interfaceNameToClassName[$interfaceName] = false;
            return false;
        } elseif (1 === $this->countObjectManagers) {
            $this->interfaceNameToClassName[$interfaceName] = array_key_exists($interfaceName, $this->baseEntityMap) ? $this->baseEntityMap[$interfaceName] : false;
            return $this->interfaceNameToClassName[$interfaceName];
        }

        foreach ($this->objectManagerToEntityMap as $entityMap) {
            if (array_key_exists($interfaceName, $entityMap)) {
                $this->interfaceNameToClassName[$interfaceName] = $entityMap[$interfaceName];
                return $this->interfaceNameToClassName[$interfaceName];
            }
        }
        $this->interfaceNameToClassName[$interfaceName] = false;
        return $this->interfaceNameToClassName[$interfaceName];
    }
52740
public function getValueBy(ParameterInterface $parameter)
    {
        if ($this->isExistBy($parameter) === false) {
            throw new NoBindParameterException('No parameter: ' . (string) $parameter);
        }

        return $this->parameters[$parameter->getHash()];
    }