@@ -548,7 +548,7 @@ private function addServiceConfigurator($id, Definition $definition, $variableNa
548
548
}
549
549
550
550
$ class = $ this ->dumpValue ($ callable [0 ]);
551
- // If the class is a string we can optimize call_user_func away
551
+ // If the class is a string we can optimize away
552
552
if (0 === strpos ($ class , "' " ) && false === strpos ($ class , '$ ' )) {
553
553
return sprintf (" %s::%s( \$%s); \n" , $ this ->dumpLiteralClass ($ class ), $ callable [1 ], $ variableName );
554
554
}
@@ -557,7 +557,7 @@ private function addServiceConfigurator($id, Definition $definition, $variableNa
557
557
return sprintf (" (%s)->%s( \$%s); \n" , $ this ->dumpValue ($ callable [0 ]), $ callable [1 ], $ variableName );
558
558
}
559
559
560
- return sprintf (" call_user_func(array( %s, '%s'), \$%s); \n" , $ this ->dumpValue ($ callable [0 ]), $ callable [1 ], $ variableName );
560
+ return sprintf (" [ %s, '%s']( \$%s); \n" , $ this ->dumpValue ($ callable [0 ]), $ callable [1 ], $ variableName );
561
561
}
562
562
563
563
return sprintf (" %s( \$%s); \n" , $ callable , $ variableName );
@@ -705,7 +705,7 @@ private function addNewInstance(Definition $definition, $return, $instantiation,
705
705
}
706
706
707
707
$ class = $ this ->dumpValue ($ callable [0 ]);
708
- // If the class is a string we can optimize call_user_func away
708
+ // If the class is a string we can optimize away
709
709
if (0 === strpos ($ class , "' " ) && false === strpos ($ class , '$ ' )) {
710
710
if ("'' " === $ class ) {
711
711
throw new RuntimeException (sprintf ('Cannot dump definition: The "%s" service is defined to be created by a factory but is missing the service reference, did you forget to define the factory service id or class? ' , $ id ));
@@ -718,7 +718,7 @@ private function addNewInstance(Definition $definition, $return, $instantiation,
718
718
return sprintf (" $ return {$ instantiation }(%s)->%s(%s); \n" , $ this ->dumpValue ($ callable [0 ]), $ callable [1 ], $ arguments ? implode (', ' , $ arguments ) : '' );
719
719
}
720
720
721
- return sprintf (" $ return {$ instantiation }call_user_func(array( %s, '%s') %s); \n" , $ this ->dumpValue ($ callable [0 ]), $ callable [1 ], $ arguments ? ' , ' . implode (', ' , $ arguments ) : '' );
721
+ return sprintf (" $ return {$ instantiation }[ %s, '%s']( %s); \n" , $ this ->dumpValue ($ callable [0 ]), $ callable [1 ], $ arguments ? implode (', ' , $ arguments ) : '' );
722
722
}
723
723
724
724
return sprintf (" $ return {$ instantiation }%s(%s); \n" , $ this ->dumpLiteralClass ($ this ->dumpValue ($ callable )), $ arguments ? implode (', ' , $ arguments ) : '' );
@@ -1385,7 +1385,7 @@ private function dumpValue($value, $interpolate = true)
1385
1385
}
1386
1386
1387
1387
if ($ factory [0 ] instanceof Definition) {
1388
- return sprintf ("call_user_func(array( %s, '%s') %s) " , $ this ->dumpValue ($ factory [0 ]), $ factory [1 ], count ( $ arguments ) > 0 ? ' , ' . implode (', ' , $ arguments ) : '' );
1388
+ return sprintf ("[ %s, '%s']( %s) " , $ this ->dumpValue ($ factory [0 ]), $ factory [1 ], implode (', ' , $ arguments ));
1389
1389
}
1390
1390
1391
1391
if ($ factory [0 ] instanceof Reference) {
0 commit comments