original_string: public function finalize(\Slim\Interfaces\Http\RequestInterface $request)
      {
          $sendBody = true;
  
          if (in_array($this->status, array(204, 304)) === true) {
              $this->headers->remove('Content-Type');
              $this->headers->remove('Content-Length');
              $sendBody = false;
          } else {
              $size = @$this->getSize();
              if ($size) {
                  $this->headers->set('Content-Length', $size);
              }
          }
  
          // Serialize cookies into HTTP header
          $this->cookies->setHeaders($this->headers);
  
          // Remove body if HEAD request
          if ($request->isHead() === true) {
              $sendBody = false;
          }
  
          // Truncate body if it should not be sent with response
          if ($sendBody === false) {
              $this->body->close();
              $this->body = new \Guzzle\Stream\Stream(fopen('php://temp', 'r+'));
          }
  
          return $this;
      }
code: public function finalize(\Slim\Interfaces\Http\RequestInterface $request)
      {
          $sendBody = true;
  
          if (in_array($this->status, array(204, 304)) === true) {
              $this->headers->remove('Content-Type');
              $this->headers->remove('Content-Length');
              $sendBody = false;
          } else {
              $size = @$this->getSize();
              if ($size) {
                  $this->headers->set('Content-Length', $size);
              }
          }
  
          // Serialize cookies into HTTP header
          $this->cookies->setHeaders($this->headers);
  
          // Remove body if HEAD request
          if ($request->isHead() === true) {
              $sendBody = false;
          }
  
          // Truncate body if it should not be sent with response
          if ($sendBody === false) {
              $this->body->close();
              $this->body = new \Guzzle\Stream\Stream(fopen('php://temp', 'r+'));
          }
  
          return $this;
      }
code_tokens: public function finalize ( \ Slim \ Interfaces \ Http \ RequestInterface $ request ) { $ sendBody = true ; if ( in_array ( $ this -> status , array ( 204 , 304 ) ) === true ) { $ this -> headers -> remove ( 'Content-Type' ) ; $ this -> headers -> remove ( 'Content-Length' ) ; $ sendBody = false ; } else { $ size = @ $ this -> getSize ( ) ; if ( $ size ) { $ this -> headers -> set ( 'Content-Length' , $ size ) ; } } // Serialize cookies into HTTP header $ this -> cookies -> setHeaders ( $ this -> headers ) ; // Remove body if HEAD request if ( $ request -> isHead ( ) === true ) { $ sendBody = false ; } // Truncate body if it should not be sent with response if ( $ sendBody === false ) { $ this -> body -> close ( ) ; $ this -> body = new \ Guzzle \ Stream \ Stream ( fopen ( 'php://temp' , 'r+' ) ) ; } return $ this ; }
docstring: Finalize response for delivery to client
  
  Apply final preparations to the resposne object
  so that it is suitable for delivery to the client.
  
  @param  \Slim\Interfaces\Http\RequestInterface $request
  @return \Slim\Interfaces\Http\Response Self
  @api
docstring_tokens: Finalize response for delivery to client