]> git.mjollnir.org Git - moodle.git/commitdiff
web service MDL-12886 documentation: manage no return value into the description...
authorjerome <jerome>
Wed, 11 Mar 2009 04:28:04 +0000 (04:28 +0000)
committerjerome <jerome>
Wed, 11 Mar 2009 04:28:04 +0000 (04:28 +0000)
webservice/documentation.php

index 2b693a85095de6978922b55b21d54015ea90d0ca..06f59c779607a01e0b99c639e2e973d5d9aa61b3 100644 (file)
@@ -104,18 +104,21 @@ EOF;
             $documentation .= <<<EOF
         <b>)</b> :
 EOF;
-            foreach($functiondescription['return'] as $return => $type) {
-                $documentation .= <<<EOF
+            if (array_key_exists('return', $functiondescription)) {
+                foreach($functiondescription['return'] as $return => $type) {
+                    $documentation .= <<<EOF
                 <i>
-                {$type}</i>
+                    {$type}</i>
 EOF;
-                if (is_array($type)) {
-                    $arraytype = "<pre>".print_r($type, true)."</pre>";
-                    $documentation .= <<<EOF
+                    if (is_array($type)) {
+                        $arraytype = "<pre>".print_r($type, true)."</pre>";
+                        $documentation .= <<<EOF
                 <i> {$return}  {$arraytype} <br><br></i>
 EOF;
+                    }
                 }
             }
+
             foreach($functiondescription['params'] as $param => $type) {
 
                 if (is_array($type)) {