protected function setHeaders(array $headers): void
    {
        if (\count($headers) === 0) {
            return;
        }

        $this->headerNames = $this->headers = [];

        foreach ($headers as $header => $value) {
            $value      = $this->filterHeaderValue($value);
            $normalized = \strtolower($header);

            if (isset($this->headerNames[$normalized])) {
                $header                 = (string) $this->headerNames[$normalized];
                $this->headers[$header] += $value;
            } else {
                $this->headerNames[$normalized] = $header;
                $this->headers[$header]         = $value;
            }
        }
    }
protected function setHeaders(array $headers): void
    {
        if (\count($headers) === 0) {
            return;
        }

        $this->headerNames = $this->headers = [];

        foreach ($headers as $header => $value) {
            $value      = $this->filterHeaderValue($value);
            $normalized = \strtolower($header);

            if (isset($this->headerNames[$normalized])) {
                $header                 = (string) $this->headerNames[$normalized];
                $this->headers[$header] += $value;
            } else {
                $this->headerNames[$normalized] = $header;
                $this->headers[$header]         = $value;
            }
        }
    }
protected function setHeaders ( array $ headers ) : void { if ( \ count ( $ headers ) === 0 ) { return ; } $ this -> headerNames = $ this -> headers = [ ] ; foreach ( $ headers as $ header => $ value ) { $ value = $ this -> filterHeaderValue ( $ value ) ; $ normalized = \ strtolower ( $ header ) ; if ( isset ( $ this -> headerNames [ $ normalized ] ) ) { $ header = ( string ) $ this -> headerNames [ $ normalized ] ; $ this -> headers [ $ header ] += $ value ; } else { $ this -> headerNames [ $ normalized ] = $ header ; $ this -> headers [ $ header ] = $ value ; } } }
Set validated headers.

@param array $headers

@return void
Set validated headers .