lithium\test\Mocker::_methodParams PHP Method

_methodParams() protected static method

For instance: 'ReflectionFunctionAbstract $method' or '$name, array $foo = null'
protected static _methodParams ( ReflectionFunctionAbstrac\ReflectionFunctionAbstract $method ) : string
$method ReflectionFunctionAbstrac\ReflectionFunctionAbstract
return string
    protected static function _methodParams(ReflectionFunctionAbstract $method)
    {
        $pattern = '/Parameter #[0-9]+ \\[ [^\\>]+>([^\\]]+) \\]/';
        $replace = array('from' => array(' Array', 'or NULL'), 'to' => array(' array()', ''));
        preg_match_all($pattern, $method, $matches);
        $params = implode(', ', $matches[1]);
        return str_replace($replace['from'], $replace['to'], $params);
    }