From 5b0800d30e426377a05b1864232aeafed6db4dc3 Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Tue, 15 May 2012 13:10:50 +0200 Subject: [PATCH] MDL-32949 ws: minor comments cleanup --- webservice/soap/locallib.php | 12 +++++++----- webservice/xmlrpc/locallib.php | 10 +++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/webservice/soap/locallib.php b/webservice/soap/locallib.php index 643de527431..e90c8f12b4b 100644 --- a/webservice/soap/locallib.php +++ b/webservice/soap/locallib.php @@ -55,14 +55,14 @@ class moodle_zend_soap_server extends Zend_Soap_Server { public function fault($fault = null, $code = "Receiver") { - //run the zend code that clean/create a soapfault + // Run the zend code that clean/create a soapfault. $soapfault = parent::fault($fault, $code); - //intercept any exceptions and add the errorcode and debuginfo (optional) + // Intercept any exceptions and add the errorcode and debuginfo (optional). $actor = null; $details = null; if ($fault instanceof Exception) { - //add the debuginfo to the exception message if debuginfo must be returned + // Add the debuginfo to the exception message if debuginfo must be returned. $actor = $fault->errorcode; if (debugging() and isset($fault->debuginfo)) { $details = $fault->debuginfo; @@ -75,10 +75,12 @@ class moodle_zend_soap_server extends Zend_Soap_Server { } /** + * Handle a request + * * NOTE: this is basically a copy of the Zend handle() * but with $soap->fault returning faultactor + faultdetail - * - * Handle a request + * So we don't require coding style checks within this method + * to keep it as similar as the original one. * * Instantiates SoapServer object with options set in object, and * dispatches its handle() method. diff --git a/webservice/xmlrpc/locallib.php b/webservice/xmlrpc/locallib.php index 6725d7ce9f5..3a853116632 100644 --- a/webservice/xmlrpc/locallib.php +++ b/webservice/xmlrpc/locallib.php @@ -48,17 +48,17 @@ class moodle_zend_xmlrpc_server extends Zend_XmlRpc_Server { */ public function fault($fault = null, $code = 404) { - //intercept any exceptions with debug info and transform it in Moodle exception + // Intercept any exceptions with debug info and transform it in Moodle exception. if ($fault instanceof Exception) { - // code php exception must be a long - // we obtain a hash of the errorcode, and then to get an integer hash + // Code php exception must be a long + // we obtain a hash of the errorcode, and then to get an integer hash. $code = base_convert(md5($fault->errorcode), 16, 10); - // code php exception being a long, it has a maximum number of digits. + // Code php exception being a long, it has a maximum number of digits. // we strip the $code to 8 digits, and hope for no error code collisions. // Collisions should be pretty rare, and if needed the client can retrieve // the accurate errorcode from the last | in the exception message. $code = substr($code, 0, 8); - //add the debuginfo to the exception message if debuginfo must be returned + // Add the debuginfo to the exception message if debuginfo must be returned. if (debugging() and isset($fault->debuginfo)) { $fault = new Exception($fault->getMessage() . ' | DEBUG INFO: ' . $fault->debuginfo . ' | ERRORCODE: ' . $fault->errorcode, $code);