public function addHeader($headers)
    {
        foreach ((array) $headers as $header) {
            if (strpos($header, "\n") !== false || strpos($header, "\r") !== false) {
                throw new \InvalidArgumentException('Headers can not contain newline characters for security reasons');
            }
            $this->headers[] = $header;
        }

        return $this;
    }
public function addHeader($headers)
    {
        foreach ((array) $headers as $header) {
            if (strpos($header, "\n") !== false || strpos($header, "\r") !== false) {
                throw new \InvalidArgumentException('Headers can not contain newline characters for security reasons');
            }
            $this->headers[] = $header;
        }

        return $this;
    }
public function addHeader ( $ headers ) { foreach ( ( array ) $ headers as $ header ) { if ( strpos ( $ header , "\n" ) !== false || strpos ( $ header , "\r" ) !== false ) { throw new \ InvalidArgumentException ( 'Headers can not contain newline characters for security reasons' ) ; } $ this -> headers [ ] = $ header ; } return $ this ; }
Add headers to the message

@param  string|array $headers Custom added headers
@return self
Add headers to the message