src/Plugin/Double.php
protected static function _generateSignature($method)
    {
        $params = [];
        $isVariadic = Suite::$PHP >= 7 ? $method->isVariadic() : false;

        foreach ($method->getParameters() as $num => $parameter) {
            $typehint = Inspector::typehint($parameter);
            $name = $parameter->getName();
            $name = ($name && $name !== '...') ? $name : 'param' . $num;
            $reference = $parameter->isPassedByReference() ? '&' : '';
            $default = '';
            if ($parameter->isDefaultValueAvailable()) {
                $default = var_export($parameter->getDefaultValue(), true);
                $default = ' = ' . preg_replace('/\s+/', '', $default);
            } elseif ($parameter->isOptional()) {
                if ($isVariadic && $parameter->isVariadic()) {
                    $reference = '...';
                    $default = '';
                } else {
                    $default = ' = NULL';
                }
            }
            $allowsNull = '';
            $typehint = $typehint ? $typehint . ' ' : $typehint;
            if (Suite::$PHP >= 7) {
                $type = $parameter->getType();
                if ($type && method_exists($type, 'allowsNull') && $type->allowsNull()) {
                    $allowsNull = '?';
                }
            }
            $params[] = "{$allowsNull}{$typehint}{$reference}\${$name}{$default}";
        }
        return join(', ', $params);
    }
protected static function _generateSignature($method)
    {
        $params = [];
        $isVariadic = Suite::$PHP >= 7 ? $method->isVariadic() : false;

        foreach ($method->getParameters() as $num => $parameter) {
            $typehint = Inspector::typehint($parameter);
            $name = $parameter->getName();
            $name = ($name && $name !== '...') ? $name : 'param' . $num;
            $reference = $parameter->isPassedByReference() ? '&' : '';
            $default = '';
            if ($parameter->isDefaultValueAvailable()) {
                $default = var_export($parameter->getDefaultValue(), true);
                $default = ' = ' . preg_replace('/\s+/', '', $default);
            } elseif ($parameter->isOptional()) {
                if ($isVariadic && $parameter->isVariadic()) {
                    $reference = '...';
                    $default = '';
                } else {
                    $default = ' = NULL';
                }
            }
            $allowsNull = '';
            $typehint = $typehint ? $typehint . ' ' : $typehint;
            if (Suite::$PHP >= 7) {
                $type = $parameter->getType();
                if ($type && method_exists($type, 'allowsNull') && $type->allowsNull()) {
                    $allowsNull = '?';
                }
            }
            $params[] = "{$allowsNull}{$typehint}{$reference}\${$name}{$default}";
        }
        return join(', ', $params);
    }
protected static function _generateSignature ( $ method ) { $ params = [ ] ; $ isVariadic = Suite :: $ PHP >= 7 ? $ method -> isVariadic ( ) : false ; foreach ( $ method -> getParameters ( ) as $ num => $ parameter ) { $ typehint = Inspector :: typehint ( $ parameter ) ; $ name = $ parameter -> getName ( ) ; $ name = ( $ name && $ name !== '...' ) ? $ name : 'param' . $ num ; $ reference = $ parameter -> isPassedByReference ( ) ? '&' : '' ; $ default = '' ; if ( $ parameter -> isDefaultValueAvailable ( ) ) { $ default = var_export ( $ parameter -> getDefaultValue ( ) , true ) ; $ default = ' = ' . preg_replace ( '/\s+/' , '' , $ default ) ; } elseif ( $ parameter -> isOptional ( ) ) { if ( $ isVariadic && $ parameter -> isVariadic ( ) ) { $ reference = '...' ; $ default = '' ; } else { $ default = ' = NULL' ; } } $ allowsNull = '' ; $ typehint = $ typehint ? $ typehint . ' ' : $ typehint ; if ( Suite :: $ PHP >= 7 ) { $ type = $ parameter -> getType ( ) ; if ( $ type && method_exists ( $ type , 'allowsNull' ) && $ type -> allowsNull ( ) ) { $ allowsNull = '?' ; } } $ params [ ] = "{$allowsNull}{$typehint}{$reference}\${$name}{$default}" ; } return join ( ', ' , $ params ) ; }
Creates a parameters signature of a `ReflectionMethod` instance.

@param  object $method A instance of `ReflectionMethod`.
@return string         The parameters definition list.
Creates a parameters signature of a ReflectionMethod instance .