$plainFuncName = 'Closure';
$exists = true;
- }
- else {
+ } else {
$plainFuncName = $callable;
$exists = function_exists($callable);
}
$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++;
* @param array $extraOptions
* @param string $plainFuncName
* @param string $funcDesc
- * @return callable
+ * @return \Closure
*/
protected function buildWrapFunctionClosure($callable, $extraOptions, $plainFuncName, $funcDesc)
{
* @param array $extraOptions
* @param string $plainFuncName
* @param array $funcDesc
- * @return array
+ * @return string
*
* @todo add a nice phpdoc block in the generated source
*/
* @param string $methodName
* @param array $extraOptions
* @param string $mSig
- * @return callable
+ * @return \Closure
*
* @todo should we allow usage of parameter simple_client_copy to mean 'do not clone' in this case?
*/
$decodeOptions[] = 'decode_php_objs';
}
- /// @todo check for insufficient nr. of args besides excess ones
+ /// @todo check for insufficient nr. of args besides excess ones? note that 'source' version does not...
// support one extra parameter: debug
$maxArgs = count($mSig)-1; // 1st element is the return type
$xmlrpcArgs = array();
foreach($currentArgs as $i => $arg) {
if ($i == $maxArgs) {
- /// @todo log warning? check what happens with the 'source' version
break;
}
$pType = $mSig[$i+1];
* @param string $mDesc
* @return array
*/
- protected function buildWrapMethodSource($client, $methodName, array $extraOptions, $newFuncName, $mSig, $mDesc='')
+ public function buildWrapMethodSource($client, $methodName, array $extraOptions, $newFuncName, $mSig, $mDesc='')
{
$timeout = isset($extraOptions['timeout']) ? (int)$extraOptions['timeout'] : 0;
$protocol = isset($extraOptions['protocol']) ? $extraOptions['protocol'] : '';