original_string: public function toResponseJSON()
      {
          // successful response
          $arr = array('jsonrpc' => self::JSON_RPC_VERSION);
          if ($this->result !== null) {
              $arr['result'] = $this->result;
              $arr['id'] = $this->id;
              return json_encode($arr);
          // error response
          } else {
              $arr['error'] = array('code' => $this->error_code, 'message' => $this->error_message);
              $arr['id'] = $this->id;
              return json_encode($arr);
          }
      }
code: public function toResponseJSON()
      {
          // successful response
          $arr = array('jsonrpc' => self::JSON_RPC_VERSION);
          if ($this->result !== null) {
              $arr['result'] = $this->result;
              $arr['id'] = $this->id;
              return json_encode($arr);
          // error response
          } else {
              $arr['error'] = array('code' => $this->error_code, 'message' => $this->error_message);
              $arr['id'] = $this->id;
              return json_encode($arr);
          }
      }
code_tokens: public function toResponseJSON ( ) { // successful response $ arr = array ( 'jsonrpc' => self :: JSON_RPC_VERSION ) ; if ( $ this -> result !== null ) { $ arr [ 'result' ] = $ this -> result ; $ arr [ 'id' ] = $ this -> id ; return json_encode ( $ arr ) ; // error response } else { $ arr [ 'error' ] = array ( 'code' => $ this -> error_code , 'message' => $ this -> error_message ) ; $ arr [ 'id' ] = $ this -> id ; return json_encode ( $ arr ) ; } }
docstring: return raw JSON response
docstring_tokens: return raw JSON response