original_string: public function setBody($body)
      {
          if (!empty($body) && !HttpCode::isBodyAllowed($this->code)) {
              throw new LogicException('You cannot set non-empty body for currently set code');
          }
  
          $this->body = (string)$body;
          $this->setHeader('Content-Length', strlen($this->body));
          $this->messageCache = null;
      }
code: public function setBody($body)
      {
          if (!empty($body) && !HttpCode::isBodyAllowed($this->code)) {
              throw new LogicException('You cannot set non-empty body for currently set code');
          }
  
          $this->body = (string)$body;
          $this->setHeader('Content-Length', strlen($this->body));
          $this->messageCache = null;
      }
code_tokens: public function setBody ( $ body ) { if ( ! empty ( $ body ) && ! HttpCode :: isBodyAllowed ( $ this -> code ) ) { throw new LogicException ( 'You cannot set non-empty body for currently set code' ) ; } $ this -> body = ( string ) $ body ; $ this -> setHeader ( 'Content-Length' , strlen ( $ this -> body ) ) ; $ this -> messageCache = null ; }
docstring: Sets body for response.
  It also automatically sets correct Content-Length header.
  
  @param string $body
  
  @throws LogicException Thrown when you try to set body, but request code (eg. 204) denotes that no body is
  allowed.
docstring_tokens: Sets body for response . It also automatically sets correct Content - Length header .