Set header

@param string $name
@param string $value
765478
protected function setHeader($name, $value)
    {
        $this->headers[strtolower($name)] = new Header($name, $value);
    }
390254
public function setHeader(string $name, string $value): void
    {
        parent::setHeader($name, $value);
    }
110058
public function addHeader(string $name, $value) : Message
    {
        $name = strtolower($name);

        if (is_array($value)) {
            $value = array_values($value);
            $this->headers[$name] = isset($this->headers[$name])
                ? array_merge($this->headers[$name], $value)
                : $value;
        } else {
            $this->headers[$name][] = $value;
        }

        return $this;
    }
814033
public function addHeader($name, $value)
    {
        if (isset($this->headers[$name])) {
            if (is_array($this->headers[$name])) {
                $this->headers[$name][] = $value;
            } else {
                $this->headers[$name] = $value;
            }
        } else {
            $this->headers[$name] = [$value];
        }

        return $this;
    }
495130
public function addDefaultHeader($name, $value)
    {
        if (!isset($this->headers[$name])) {
            $this->headers[$name] = $value;
        }

        return $this;
    }
1217330
public function header($name, $value = null)
    {

        if ($value === null) {
            $this->headers[] = $name;
        } else {
            $this->headers[] = $this->headerString($name, $value);
        }

        return $this;
    }
997985
protected function addHeader(string $name, $value)
    {
        \assert($this->isNameValid($name), "Invalid header name");

        if (\is_array($value)) {
            if (!$value) {
                return;
            }

            $value = \array_values(\array_map("strval", $value));
        } else {
            $value = [(string) $value];
        }

        \assert($this->isValueValid($value), "Invalid header value");

        $name = \strtolower($name);
        if (isset($this->headers[$name])) {
            $this->headers[$name] = \array_merge($this->headers[$name], $value);
        } else {
            $this->headers[$name] = $value;
        }
    }
649122
public function set(string $header, string $value) : void
    {
        $this->headers[$header] = $value;
    }
578501
protected function setHeader(string $name, $value)
    {
        if (!$this->isHeaderNameValid($name)) {
            throw new InvalidHeaderException('Header name is invalid.');
        }

        $normalized = strtolower($name);
        $value = $this->filterHeader($value);

        // Header may have been previously set with a different case. If so, remove that header.
        if (isset($this->headerNameMap[$normalized]) && $this->headerNameMap[$normalized] !== $name) {
            unset($this->headers[$this->headerNameMap[$normalized]]);
        }

        $this->headerNameMap[$normalized] = $name;
        $this->headers[$name] = $value;
    }
475820
public function addHeader($name, $value)
    {
        $this->getSwiftMessage()->getHeaders()->addTextHeader($name, $value);
        return $this;
    }
718201
public function withHeader($name, $value): self
    {
        $this->assertHeaderName($name);

        $clone = clone $this;
        $clone->headers->set($name, $value);

        return $clone;
    }
132901
public function withHeader(string $name, string $value)
    {
        $this->defaultHeaders[$name] = $value;

        return $this;
    }
611715
protected function setHeader(string $name, $value)
    {
        \assert($this->isNameValid($name), "Invalid header name");

        if (\is_array($value)) {
            if (!$value) {
                $this->removeHeader($name);
                return;
            }

            $value = \array_values(\array_map("strval", $value));
        } else {
            $value = [(string) $value];
        }

        \assert($this->isValueValid($value), "Invalid header value");

        $name = \strtolower($name);
        $this->headers[$name] = $value;
    }
1168212
public function setHeader($name, $value)
    {
        $this->getResponse()->headers->set($name, $value);

        return $this;
    }
1328351
public function set(string $name, string $value): void
    {
        $this->dataContainer[RequestDataContainer::VAR_HEADER_RAW][$name] = $value;
    }
277013
public function header($name, $value)
        {
            $this->foundation->headers->set($name, $value);
            return $this;
        }
1335473
public void set(String name, String value)
    {
        HeaderName hn = getHeaderName(name);
        set(hn, value);
    }