protected static function getArgumentDeclaration(\ReflectionMethod $method)
    {
        $declarations = array();
        $parameters = explode(', ', self::getMethodParameters($method));

        foreach ($parameters as $parameter) {

            if (0 < strpos(trim($parameter), ' $') && false === strpos($parameter, 'array')) {
                $declarations[] = '\\' . $parameter;
                continue;
            }

            $declarations[] = $parameter;
        }

        return implode(', ', $declarations);
    }
protected static function getArgumentDeclaration(\ReflectionMethod $method)
    {
        $declarations = array();
        $parameters = explode(', ', self::getMethodParameters($method));

        foreach ($parameters as $parameter) {

            if (0 < strpos(trim($parameter), ' $') && false === strpos($parameter, 'array')) {
                $declarations[] = '\\' . $parameter;
                continue;
            }

            $declarations[] = $parameter;
        }

        return implode(', ', $declarations);
    }
protected static function getArgumentDeclaration ( \ ReflectionMethod $ method ) { $ declarations = array ( ) ; $ parameters = explode ( ', ' , self :: getMethodParameters ( $ method ) ) ; foreach ( $ parameters as $ parameter ) { if ( 0 < strpos ( trim ( $ parameter ) , ' $' ) && false === strpos ( $ parameter , 'array' ) ) { $ declarations [ ] = '\\' . $ parameter ; continue ; } $ declarations [ ] = $ parameter ; } return implode ( ', ' , $ declarations ) ; }
Adds prefix for global namespace to the type hint of each parameter of the method.

This method is only necessary 'cause PHPUnit is currently not able to detect the usage of
namespaces. Thus it does not add the '\' to a type hint.

@param \ReflectionMethod $method

@return string
Adds prefix for global namespace to the type hint of each parameter of the method .