public function append($headers): self
    {
        if (is_string($headers)) {
            $append = self::parse($headers);
        } elseif (is_array($headers)) {
            $append = $headers;
        } elseif ($headers instanceof self) {
            $append = $headers->headers;
        } else {
            throw new \InvalidArgumentException(
                    'Given headers must be a string, a list of headers'
                    . ' or another instance of ' . __CLASS__
            );
        }

        $this->headers = array_merge($this->headers, $append);
        return $this;
    }
public function append($headers): self
    {
        if (is_string($headers)) {
            $append = self::parse($headers);
        } elseif (is_array($headers)) {
            $append = $headers;
        } elseif ($headers instanceof self) {
            $append = $headers->headers;
        } else {
            throw new \InvalidArgumentException(
                    'Given headers must be a string, a list of headers'
                    . ' or another instance of ' . __CLASS__
            );
        }

        $this->headers = array_merge($this->headers, $append);
        return $this;
    }
public function append ( $ headers ) : self { if ( is_string ( $ headers ) ) { $ append = self :: parse ( $ headers ) ; } elseif ( is_array ( $ headers ) ) { $ append = $ headers ; } elseif ( $ headers instanceof self ) { $ append = $ headers -> headers ; } else { throw new \ InvalidArgumentException ( 'Given headers must be a string, a list of headers' . ' or another instance of ' . __CLASS__ ) ; } $ this -> headers = array_merge ( $ this -> headers , $ append ) ; return $ this ; }
appends given headers

If the header to append contain an already set header the existing header
value will be overwritten by the new one.

@param   string|array|\stubbles\peer\HeaderList  $headers
@return  \stubbles\peer\HeaderList
@throws  \InvalidArgumentException
@since   2.0.0
appends given headers