Fix: better generation of method signatures in wrap_php_ calls
authorgggeek <giunta.gaetano@gmail.com>
Sat, 30 May 2015 09:47:07 +0000 (11:47 +0200)
committergggeek <giunta.gaetano@gmail.com>
Sat, 30 May 2015 09:47:07 +0000 (11:47 +0200)
NEWS
src/Wrapper.php

diff --git a/NEWS b/NEWS
index d941bcf..8d8c130 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -60,7 +60,8 @@ PLEASE READ CAREFULLY THE NOTES BELOW to insure a smooth upgrade.
 * fixed: the debugger would fail sending a request with ISO-8859-1 payload (it missed the character set declaration).
   It would have a hard time coping with ISO-8859-1 in other fields, such as e.g. the remote method name
 
-* fixed: the debugger would generate a bad payload via the 'load method synopsis' button for signatures containing NULLs
+* fixed: the debugger would generate a bad payload via the 'load method synopsis' button for signatures containing NULL
+  or undefined parameters
 
 * fixed: the debugger would generate a bad payload via the 'load method synopsis' button for methods with multiple
   signatures
index 21321a6..f7f2072 100644 (file)
@@ -280,10 +280,10 @@ class Wrapper
                     $desc .= $doc;
                 } elseif (strpos($doc, '@param') === 0) {
                     // syntax: @param type $name [desc]
-                    if (preg_match('/@param\s+(\S+)\s+(\$\S+)\s+(.+)?/', $doc, $matches)) {
+                    if (preg_match('/@param\s+(\S+)\s+(\$\S+)\s*(.+)?/', $doc, $matches)) {
                         $name = strtolower(trim($matches[2]));
                         //$paramDocs[$name]['name'] = trim($matches[2]);
-                        $paramDocs[$name]['doc'] = $matches[3];
+                        $paramDocs[$name]['doc'] = isset($matches[3]) ? $matches[3] : '';
                         $paramDocs[$name]['type'] = $matches[1];
                     }
                     $i++;