public function setHeader(string $name, $value)
	{
		if (! isset($this->headers[$name]))
		{
			$this->headers[$name] = new Header($name, $value);

			$this->headerMap[strtolower($name)] = $name;

			return $this;
		}

		if (! is_array($this->headers[$name]))
		{
			$this->headers[$name] = [$this->headers[$name]];
		}

		if (isset($this->headers[$name]))
		{
			$this->headers[$name] = new Header($name, $value);
		}

		return $this;
	}
public function setHeader(string $name, $value)
	{
		if (! isset($this->headers[$name]))
		{
			$this->headers[$name] = new Header($name, $value);

			$this->headerMap[strtolower($name)] = $name;

			return $this;
		}

		if (! is_array($this->headers[$name]))
		{
			$this->headers[$name] = [$this->headers[$name]];
		}

		if (isset($this->headers[$name]))
		{
			$this->headers[$name] = new Header($name, $value);
		}

		return $this;
	}
public function setHeader ( string $ name , $ value ) { if ( ! isset ( $ this -> headers [ $ name ] ) ) { $ this -> headers [ $ name ] = new Header ( $ name , $ value ) ; $ this -> headerMap [ strtolower ( $ name ) ] = $ name ; return $ this ; } if ( ! is_array ( $ this -> headers [ $ name ] ) ) { $ this -> headers [ $ name ] = [ $ this -> headers [ $ name ] ] ; } if ( isset ( $ this -> headers [ $ name ] ) ) { $ this -> headers [ $ name ] = new Header ( $ name , $ value ) ; } return $ this ; }
Sets a header and it's value.

@param string            $name
@param array|null|string $value

@return Message|Response
Sets a header and it s value .