original_string: public function emit(EmitterInterface $emitter = null)
      {
          if ($this->isStale) {
              throw new \BadMethodCallException("Unable to emit a stale response object");
          }
          
          if (!isset($emitter)) {
              $emitter = $this->createEmitter();
          }
          
          if (isset($this->status) && !$this->status instanceof GlobalResponseStatus) {
              $emitter->emitStatus($this);
          }
          
          if (isset($this->headers) && !$this->headers instanceof GlobalResponseHeaders) {
              $emitter->emitHeaders($this);
          }
          
          if (isset($this->body) && $this->body->getMetadata('url') !== 'php://output') {
              $emitter->emitBody($this);
          }
      }
code: public function emit(EmitterInterface $emitter = null)
      {
          if ($this->isStale) {
              throw new \BadMethodCallException("Unable to emit a stale response object");
          }
          
          if (!isset($emitter)) {
              $emitter = $this->createEmitter();
          }
          
          if (isset($this->status) && !$this->status instanceof GlobalResponseStatus) {
              $emitter->emitStatus($this);
          }
          
          if (isset($this->headers) && !$this->headers instanceof GlobalResponseHeaders) {
              $emitter->emitHeaders($this);
          }
          
          if (isset($this->body) && $this->body->getMetadata('url') !== 'php://output') {
              $emitter->emitBody($this);
          }
      }
code_tokens: public function emit ( EmitterInterface $ emitter = null ) { if ( $ this -> isStale ) { throw new \ BadMethodCallException ( "Unable to emit a stale response object" ) ; } if ( ! isset ( $ emitter ) ) { $ emitter = $ this -> createEmitter ( ) ; } if ( isset ( $ this -> status ) && ! $ this -> status instanceof GlobalResponseStatus ) { $ emitter -> emitStatus ( $ this ) ; } if ( isset ( $ this -> headers ) && ! $ this -> headers instanceof GlobalResponseHeaders ) { $ emitter -> emitHeaders ( $ this ) ; } if ( isset ( $ this -> body ) && $ this -> body -> getMetadata ( 'url' ) !== 'php://output' ) { $ emitter -> emitBody ( $ this ) ; } }
docstring: Emit the response
  
  @param EmitterInterface $emitter
docstring_tokens: Emit the response