public function getParameter($nameOrIndex): PhpParameter {
		if (is_int($nameOrIndex)) {
			$this->checkPosition($nameOrIndex);
			return $this->parameters[$nameOrIndex];
		}

		foreach ($this->parameters as $param) {
			if ($param->getName() === $nameOrIndex) {
				return $param;
			}
		}

		throw new \InvalidArgumentException(sprintf('There is no parameter named "%s".', $nameOrIndex));
	}
public function getParameter($nameOrIndex): PhpParameter {
		if (is_int($nameOrIndex)) {
			$this->checkPosition($nameOrIndex);
			return $this->parameters[$nameOrIndex];
		}

		foreach ($this->parameters as $param) {
			if ($param->getName() === $nameOrIndex) {
				return $param;
			}
		}

		throw new \InvalidArgumentException(sprintf('There is no parameter named "%s".', $nameOrIndex));
	}
public function getParameter ( $ nameOrIndex ) : PhpParameter { if ( is_int ( $ nameOrIndex ) ) { $ this -> checkPosition ( $ nameOrIndex ) ; return $ this -> parameters [ $ nameOrIndex ] ; } foreach ( $ this -> parameters as $ param ) { if ( $ param -> getName ( ) === $ nameOrIndex ) { return $ param ; } } throw new \ InvalidArgumentException ( sprintf ( 'There is no parameter named "%s".' , $ nameOrIndex ) ) ; }
Returns a parameter by index or name

@param string|int $nameOrIndex
@throws \InvalidArgumentException
@return PhpParameter
Returns a parameter by index or name