original_string: public function setCode($code)
      {
          $code = (int)$code;
  
          if (!empty($this->body) && !HttpCode::isBodyAllowed($code)) { //InvalidArgumentException can be thrown here
              throw new LogicException('HTTP response already contains body - response "' . HttpCode::getName($code) . '" cannot contain body.');
          }
  
          $this->code = $code;
          $this->messageCache = null;
      }
code: public function setCode($code)
      {
          $code = (int)$code;
  
          if (!empty($this->body) && !HttpCode::isBodyAllowed($code)) { //InvalidArgumentException can be thrown here
              throw new LogicException('HTTP response already contains body - response "' . HttpCode::getName($code) . '" cannot contain body.');
          }
  
          $this->code = $code;
          $this->messageCache = null;
      }
code_tokens: public function setCode ( $ code ) { $ code = ( int ) $ code ; if ( ! empty ( $ this -> body ) && ! HttpCode :: isBodyAllowed ( $ code ) ) { //InvalidArgumentException can be thrown here throw new LogicException ( 'HTTP response already contains body - response "' . HttpCode :: getName ( $ code ) . '" cannot contain body.' ) ; } $ this -> code = $ code ; $ this -> messageCache = null ; }
docstring: Sets HTTP code for response.
  
  @param integer $code Any valid HTTP code
  
  @throws InvalidArgumentException Exception is raised if you try to set invalid HTTP code.
  @throws LogicException Exception is raised if you try to set code which should not contain a body and body is
  already present.
docstring_tokens: Sets HTTP code for response .