src/SplatToCallUserFuncArrayVisitor.php
protected function splatToCallUserFuncArray($callee, $variables)
    {
        $totalVars = count($variables);
        $splatVar = $variables[$totalVars - 1];
        $mergeVars = [];
        for ($i = 0; $i < $totalVars - 1; $i++) {
            $mergeVars[] = $variables[$i];
        }

        return new Expr\FuncCall(
            new Name('call_user_func_array'),
            [
                $callee,
                new Expr\FuncCall(
                    new Name('array_merge'),
                    [new Expr\Array_($mergeVars), $splatVar]
                )
            ]
        );
    }
protected function splatToCallUserFuncArray($callee, $variables)
    {
        $totalVars = count($variables);
        $splatVar = $variables[$totalVars - 1];
        $mergeVars = [];
        for ($i = 0; $i < $totalVars - 1; $i++) {
            $mergeVars[] = $variables[$i];
        }

        return new Expr\FuncCall(
            new Name('call_user_func_array'),
            [
                $callee,
                new Expr\FuncCall(
                    new Name('array_merge'),
                    [new Expr\Array_($mergeVars), $splatVar]
                )
            ]
        );
    }
protected function splatToCallUserFuncArray ( $ callee , $ variables ) { $ totalVars = count ( $ variables ) ; $ splatVar = $ variables [ $ totalVars - 1 ] ; $ mergeVars = [ ] ; for ( $ i = 0 ; $ i < $ totalVars - 1 ; $ i ++ ) { $ mergeVars [ ] = $ variables [ $ i ] ; } return new Expr \ FuncCall ( new Name ( 'call_user_func_array' ) , [ $ callee , new Expr \ FuncCall ( new Name ( 'array_merge' ) , [ new Expr \ Array_ ( $ mergeVars ) , $ splatVar ] ) ] ) ; }
Splact function call to call_user_func_array.
@param  \PhpParser\Node                      $callee    Callee node
@param  array[\PhpParser\Node\Expr\Variable] $variables Node variables
@return \PhpParser\Node\Expr\FuncCall call_user_func_array node
Splact function call to call_user_func_array .