original_string: protected function prepare_response() {
          try {
              if (!empty($this->function->returns_desc)) {
                  $validatedvalues = external_api::clean_returnvalue($this->function->returns_desc, $this->returns);
                  $encodingoptions = array(
                      "encoding" => "UTF-8",
                      "verbosity" => "no_white_space",
                      // See MDL-54868.
                      "escaping" => ["markup"]
                  );
                  // We can now convert the response to the requested XML-RPC format.
                  $this->response = xmlrpc_encode_request(null, $validatedvalues, $encodingoptions);
              }
          } catch (invalid_response_exception $ex) {
              $this->response = $this->generate_error($ex);
          }
      }
code: protected function prepare_response() {
          try {
              if (!empty($this->function->returns_desc)) {
                  $validatedvalues = external_api::clean_returnvalue($this->function->returns_desc, $this->returns);
                  $encodingoptions = array(
                      "encoding" => "UTF-8",
                      "verbosity" => "no_white_space",
                      // See MDL-54868.
                      "escaping" => ["markup"]
                  );
                  // We can now convert the response to the requested XML-RPC format.
                  $this->response = xmlrpc_encode_request(null, $validatedvalues, $encodingoptions);
              }
          } catch (invalid_response_exception $ex) {
              $this->response = $this->generate_error($ex);
          }
      }
code_tokens: protected function prepare_response ( ) { try { if ( ! empty ( $ this -> function -> returns_desc ) ) { $ validatedvalues = external_api :: clean_returnvalue ( $ this -> function -> returns_desc , $ this -> returns ) ; $ encodingoptions = array ( "encoding" => "UTF-8" , "verbosity" => "no_white_space" , // See MDL-54868. "escaping" => [ "markup" ] ) ; // We can now convert the response to the requested XML-RPC format. $ this -> response = xmlrpc_encode_request ( null , $ validatedvalues , $ encodingoptions ) ; } } catch ( invalid_response_exception $ ex ) { $ this -> response = $ this -> generate_error ( $ ex ) ; } }
docstring: Prepares the response.
docstring_tokens: Prepares the response .