Fix: better generation of method signatures in wrap_php_ calls
[plcapi.git] / src / Wrapper.php
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++;