original_string: public function finalize() {
          if (!$this->responded) {
              $this->responded = true;
  
              // Finalise session if it has been used
              if (isset($_SESSION)) {
                  // Save flash messages to session
                  $this['flash']->save();
  
                  // Encrypt, save, close session
                  if ($this->config('session.encrypt') === true) {
                      $this['session']->encrypt($this['crypt']);
                  }
                  $this['session']->save();
              }
  
              // Encrypt cookies
              if ($this['settings']['cookies.encrypt']) {
                  $this['response']->encryptCookies($this['crypt']);
              }
  
              // Send response
              $this['response']->finalize($this['request'])->send();
          }
      }
code: public function finalize() {
          if (!$this->responded) {
              $this->responded = true;
  
              // Finalise session if it has been used
              if (isset($_SESSION)) {
                  // Save flash messages to session
                  $this['flash']->save();
  
                  // Encrypt, save, close session
                  if ($this->config('session.encrypt') === true) {
                      $this['session']->encrypt($this['crypt']);
                  }
                  $this['session']->save();
              }
  
              // Encrypt cookies
              if ($this['settings']['cookies.encrypt']) {
                  $this['response']->encryptCookies($this['crypt']);
              }
  
              // Send response
              $this['response']->finalize($this['request'])->send();
          }
      }
code_tokens: public function finalize ( ) { if ( ! $ this -> responded ) { $ this -> responded = true ; // Finalise session if it has been used if ( isset ( $ _SESSION ) ) { // Save flash messages to session $ this [ 'flash' ] -> save ( ) ; // Encrypt, save, close session if ( $ this -> config ( 'session.encrypt' ) === true ) { $ this [ 'session' ] -> encrypt ( $ this [ 'crypt' ] ) ; } $ this [ 'session' ] -> save ( ) ; } // Encrypt cookies if ( $ this [ 'settings' ] [ 'cookies.encrypt' ] ) { $ this [ 'response' ] -> encryptCookies ( $ this [ 'crypt' ] ) ; } // Send response $ this [ 'response' ] -> finalize ( $ this [ 'request' ] ) -> send ( ) ; } }
docstring: Finalize send response
  
  This method sends the response object
docstring_tokens: Finalize send response