src/Valkyrja/HttpMessage/MessageTrait.php
public function withAddedHeader(string $name, string ...$values)
    {
        HeaderSecurity::assertValidName($name);

        if (! $this->hasHeader($name)) {
            return $this->withHeader($name);
        }

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

        $new = clone $this;

        $values = $this->assertHeaderValues(...$values);

        $new->headers[$name] = array_merge($this->headers[$name], $values);

        return $new;
    }
public function withAddedHeader(string $name, string ...$values)
    {
        HeaderSecurity::assertValidName($name);

        if (! $this->hasHeader($name)) {
            return $this->withHeader($name);
        }

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

        $new = clone $this;

        $values = $this->assertHeaderValues(...$values);

        $new->headers[$name] = array_merge($this->headers[$name], $values);

        return $new;
    }
Return an instance with the specified header appended with the given
value.

Existing values for the specified header will be maintained. The new
value(s) will be appended to the existing list. If the header did not
exist previously, it will be added.

This method MUST be implemented in such a way as to retain the
immutability of the message, and MUST return an instance that has the
new header and/or value.

@param string   $name      Case-insensitive header field name to add.
@param string[] ...$values Header values.

@throws \InvalidArgumentException for invalid header names or values.

@return static