protected function copy()
    {
        if ($this->isStale) {
            throw new \BadMethodCallException("Unable to modify a stale response object");
        }
        
        $response = clone $this;
        
        if ($this->isStale === false) {
            $this->status = new ResponseStatus($this->status);
            $this->headers = new Headers($this->getHeaders());

            $this->isStale = true;
        }
        
        return $response;
    }
protected function copy()
    {
        if ($this->isStale) {
            throw new \BadMethodCallException("Unable to modify a stale response object");
        }
        
        $response = clone $this;
        
        if ($this->isStale === false) {
            $this->status = new ResponseStatus($this->status);
            $this->headers = new Headers($this->getHeaders());

            $this->isStale = true;
        }
        
        return $response;
    }
protected function copy ( ) { if ( $ this -> isStale ) { throw new \ BadMethodCallException ( "Unable to modify a stale response object" ) ; } $ response = clone $ this ; if ( $ this -> isStale === false ) { $ this -> status = new ResponseStatus ( $ this -> status ) ; $ this -> headers = new Headers ( $ this -> getHeaders ( ) ) ; $ this -> isStale = true ; } return $ response ; }
Clone the response.
Turn stale if the response is bound to the global environment.

@return static  A non-stale response
@throws \BadMethodCallException when the response is stale
Clone the response . Turn stale if the response is bound to the global environment .