public function sendResponseHttpHeaders(ResponseInterface $response):void
    {
        // checking
        if (headers_sent()) {
            throw new ResponseSenderException("A response has already been sent to the web browser",
                $this);
        }

        // removing PHP native HTTP headers (if enabled)
        if ($this->removePhpHttpHeaders) {
            foreach (headers_list() as $header) {
                header_remove(explode(":", $header)[0]);
            }
        }

        // sending response HTTP headers
        $this->sendHttpVersionHeader(
            $response->getProtocolVersion(),
            $response->getStatusCode(),
            $response->getReasonPhrase()
        );
        $this->sendHttpHeaders($this->listResponseHeaders($response));
    }
public function sendResponseHttpHeaders(ResponseInterface $response):void
    {
        // checking
        if (headers_sent()) {
            throw new ResponseSenderException("A response has already been sent to the web browser",
                $this);
        }

        // removing PHP native HTTP headers (if enabled)
        if ($this->removePhpHttpHeaders) {
            foreach (headers_list() as $header) {
                header_remove(explode(":", $header)[0]);
            }
        }

        // sending response HTTP headers
        $this->sendHttpVersionHeader(
            $response->getProtocolVersion(),
            $response->getStatusCode(),
            $response->getReasonPhrase()
        );
        $this->sendHttpHeaders($this->listResponseHeaders($response));
    }
public function sendResponseHttpHeaders ( ResponseInterface $ response ) : void { // checking if ( headers_sent ( ) ) { throw new ResponseSenderException ( "A response has already been sent to the web browser" , $ this ) ; } // removing PHP native HTTP headers (if enabled) if ( $ this -> removePhpHttpHeaders ) { foreach ( headers_list ( ) as $ header ) { header_remove ( explode ( ":" , $ header ) [ 0 ] ) ; } } // sending response HTTP headers $ this -> sendHttpVersionHeader ( $ response -> getProtocolVersion ( ) , $ response -> getStatusCode ( ) , $ response -> getReasonPhrase ( ) ) ; $ this -> sendHttpHeaders ( $ this -> listResponseHeaders ( $ response ) ) ; }
Sends the response HTTP headers.

@param ResponseInterface $response
@throws ResponseSenderException
Sends the response HTTP headers .