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));
	}