original_string: public function emitResponse(ServerRequestInterface $request, ResponseInterface $response)
      {
          try {
              $this->getResponseEmitter()->emit($response);
          } catch (\Exception $e) {
              if ($this->canForceResponseEmitting()) {
                  // flush buffers
                  $maxBufferLevel = ob_get_level();
  
                  while (ob_get_level() > $maxBufferLevel) {
                      ob_end_flush();
                  }
  
                  // print response
                  echo $response->getBody();
              } else {
                  throw $e;
              }
          }
          $applicationEvent = $this->getApplicationEvent();
          $applicationEvent->setName(self::EVENT_RESPONSE_SENT);
          $applicationEvent->setRequest($request);
          $applicationEvent->setResponse($response);
          $this->emit($applicationEvent);
      }
code: public function emitResponse(ServerRequestInterface $request, ResponseInterface $response)
      {
          try {
              $this->getResponseEmitter()->emit($response);
          } catch (\Exception $e) {
              if ($this->canForceResponseEmitting()) {
                  // flush buffers
                  $maxBufferLevel = ob_get_level();
  
                  while (ob_get_level() > $maxBufferLevel) {
                      ob_end_flush();
                  }
  
                  // print response
                  echo $response->getBody();
              } else {
                  throw $e;
              }
          }
          $applicationEvent = $this->getApplicationEvent();
          $applicationEvent->setName(self::EVENT_RESPONSE_SENT);
          $applicationEvent->setRequest($request);
          $applicationEvent->setResponse($response);
          $this->emit($applicationEvent);
      }
code_tokens: public function emitResponse ( ServerRequestInterface $ request , ResponseInterface $ response ) { try { $ this -> getResponseEmitter ( ) -> emit ( $ response ) ; } catch ( \ Exception $ e ) { if ( $ this -> canForceResponseEmitting ( ) ) { // flush buffers $ maxBufferLevel = ob_get_level ( ) ; while ( ob_get_level ( ) > $ maxBufferLevel ) { ob_end_flush ( ) ; } // print response echo $ response -> getBody ( ) ; } else { throw $ e ; } } $ applicationEvent = $ this -> getApplicationEvent ( ) ; $ applicationEvent -> setName ( self :: EVENT_RESPONSE_SENT ) ; $ applicationEvent -> setRequest ( $ request ) ; $ applicationEvent -> setResponse ( $ response ) ; $ this -> emit ( $ applicationEvent ) ; }
docstring: Emit a response
  
  @param \Psr\Http\Message\ServerRequestInterface $request
  @param \Psr\Http\Message\ResponseInterface $response
  @throws \Exception
docstring_tokens: Emit a response