public static function getMethodParameters($instance, string $method)
    {
        try {
            if (! is_callable([$instance, $method])) {
                return false;
            }

            $reflection = static::getReflectionMethod($instance, $method);
            if ($reflection instanceof ReflectionMethod === false) {
                return false;
            }

            $params = [];
            foreach ($reflection->getParameters() as $param) {
                $params[$param->getName()] = $param->isDefaultValueAvailable() ? $param->getDefaultValue() : null;
            }
            return $params;

        } catch (ReflectionException $e) {}
    }
public static function getMethodParameters($instance, string $method)
    {
        try {
            if (! is_callable([$instance, $method])) {
                return false;
            }

            $reflection = static::getReflectionMethod($instance, $method);
            if ($reflection instanceof ReflectionMethod === false) {
                return false;
            }

            $params = [];
            foreach ($reflection->getParameters() as $param) {
                $params[$param->getName()] = $param->isDefaultValueAvailable() ? $param->getDefaultValue() : null;
            }
            return $params;

        } catch (ReflectionException $e) {}
    }
public static function getMethodParameters ( $ instance , string $ method ) { try { if ( ! is_callable ( [ $ instance , $ method ] ) ) { return false ; } $ reflection = static :: getReflectionMethod ( $ instance , $ method ) ; if ( $ reflection instanceof ReflectionMethod === false ) { return false ; } $ params = [ ] ; foreach ( $ reflection -> getParameters ( ) as $ param ) { $ params [ $ param -> getName ( ) ] = $ param -> isDefaultValueAvailable ( ) ? $ param -> getDefaultValue ( ) : null ; } return $ params ; } catch ( ReflectionException $ e ) { } }
Returns an array of parameter names for the given method instance.

@param $instance
@param string $method
@return array|bool
Returns an array of parameter names for the given method instance .