src/ResponseTrait.php
protected function setResponseHeaders(array $headers)
    {
        // reset headers
        $this->headers = [];

        // set response status header
        $this->headers[] = 'HTTP/1.1 ' . $this->getStatusCode() . ' ' . $this->getStatusText();

        // set content type header
        $this->headers['Content-Type'] = 'application/json';

        // set user supplied headers
        foreach ($headers as $key => $value) {
            $this->headers[$key] = $value;
        }
    }
protected function setResponseHeaders(array $headers)
    {
        // reset headers
        $this->headers = [];

        // set response status header
        $this->headers[] = 'HTTP/1.1 ' . $this->getStatusCode() . ' ' . $this->getStatusText();

        // set content type header
        $this->headers['Content-Type'] = 'application/json';

        // set user supplied headers
        foreach ($headers as $key => $value) {
            $this->headers[$key] = $value;
        }
    }
protected function setResponseHeaders ( array $ headers ) { // reset headers $ this -> headers = [ ] ; // set response status header $ this -> headers [ ] = 'HTTP/1.1 ' . $ this -> getStatusCode ( ) . ' ' . $ this -> getStatusText ( ) ; // set content type header $ this -> headers [ 'Content-Type' ] = 'application/json' ; // set user supplied headers foreach ( $ headers as $ key => $ value ) { $ this -> headers [ $ key ] = $ value ; } }
Sets the response headers

@param array $headers
@return void
Sets the response headers