public function getHeader($key) { if ($this->hasHeader($key)) { return $this->headers[$key]; } throw new \InvalidArgumentException(sprintf('The header "%s" does not exist.', $key)); }