public static function closure(\Closure $transformer, array $params): array
    {
        if (empty($params)) {
            return $params;
        }

        try {
            list($args, $extra) = self::interpretFunction(
                new \ReflectionFunction($transformer),
                $params
            );

            return array_merge(
                $args,
                $extra
            );
        } catch (\ReflectionException $e) {
            // Sorry
        }

        return [];
    }
public static function closure(\Closure $transformer, array $params): array
    {
        if (empty($params)) {
            return $params;
        }

        try {
            list($args, $extra) = self::interpretFunction(
                new \ReflectionFunction($transformer),
                $params
            );

            return array_merge(
                $args,
                $extra
            );
        } catch (\ReflectionException $e) {
            // Sorry
        }

        return [];
    }
public static function closure ( \ Closure $ transformer , array $ params ) : array { if ( empty ( $ params ) ) { return $ params ; } try { list ( $ args , $ extra ) = self :: interpretFunction ( new \ ReflectionFunction ( $ transformer ) , $ params ) ; return array_merge ( $ args , $ extra ) ; } catch ( \ ReflectionException $ e ) { // Sorry } return [ ] ; }
Extracts all of the valid arguments for a provided Closure.

@param $transformer
@param array $params
@return array
Extracts all of the valid arguments for a provided Closure .