public function setHeaders(array $headers = []): Response
    {
        // If the headers have no been set yet
        if (null === $this->headers) {
            // Set them to a new Headers collection
            $this->headers = new Headers();
        }

        // Set all the headers with the array provided
        $this->headers->setAll($headers);

        // If there is no cache control header
        if (! $this->headers->has('Cache-Control')) {
            // Set it to an empty string
            $this->headers->set('Cache-Control', '');
        }

        return $this;
    }
public function setHeaders(array $headers = []): Response
    {
        // If the headers have no been set yet
        if (null === $this->headers) {
            // Set them to a new Headers collection
            $this->headers = new Headers();
        }

        // Set all the headers with the array provided
        $this->headers->setAll($headers);

        // If there is no cache control header
        if (! $this->headers->has('Cache-Control')) {
            // Set it to an empty string
            $this->headers->set('Cache-Control', '');
        }

        return $this;
    }
public function setHeaders ( array $ headers = [ ] ) : Response { // If the headers have no been set yet if ( null === $ this -> headers ) { // Set them to a new Headers collection $ this -> headers = new Headers ( ) ; } // Set all the headers with the array provided $ this -> headers -> setAll ( $ headers ) ; // If there is no cache control header if ( ! $ this -> headers -> has ( 'Cache-Control' ) ) { // Set it to an empty string $ this -> headers -> set ( 'Cache-Control' , '' ) ; } return $ this ; }
Set response headers.

@param array $headers [optional] The headers to set

@return \Valkyrja\Http\Response
Set response headers .