@@ -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 );
@@ -731,7 +731,7 @@ private function addNewInstance(Definition $definition, $return, $instantiation,
731
731
}
732
732
733
733
$ class = $ this ->dumpValue ($ callable [0 ]);
734
- // If the class is a string we can optimize call_user_func away
734
+ // If the class is a string we can optimize away
735
735
if (0 === strpos ($ class , "' " ) && false === strpos ($ class , '$ ' )) {
736
736
if ("'' " === $ class ) {
737
737
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 ));
@@ -744,7 +744,7 @@ private function addNewInstance(Definition $definition, $return, $instantiation,
744
744
return sprintf (" $ return {$ instantiation }(%s)->%s(%s); \n" , $ this ->dumpValue ($ callable [0 ]), $ callable [1 ], $ arguments ? implode (', ' , $ arguments ) : '' );
745
745
}
746
746
747
- return sprintf (" $ return {$ instantiation }call_user_func(array( %s, '%s') %s); \n" , $ this ->dumpValue ($ callable [0 ]), $ callable [1 ], $ arguments ? ' , ' . implode (', ' , $ arguments ) : '' );
747
+ return sprintf (" $ return {$ instantiation }[ %s, '%s']( %s); \n" , $ this ->dumpValue ($ callable [0 ]), $ callable [1 ], $ arguments ? implode (', ' , $ arguments ) : '' );
748
748
}
749
749
750
750
return sprintf (" $ return {$ instantiation }%s(%s); \n" , $ this ->dumpLiteralClass ($ this ->dumpValue ($ callable )), $ arguments ? implode (', ' , $ arguments ) : '' );
@@ -1411,7 +1411,7 @@ private function dumpValue($value, $interpolate = true)
1411
1411
}
1412
1412
1413
1413
if ($ factory [0 ] instanceof Definition) {
1414
- return sprintf ("call_user_func(array( %s, '%s') %s) " , $ this ->dumpValue ($ factory [0 ]), $ factory [1 ], count ( $ arguments ) > 0 ? ' , ' . implode (', ' , $ arguments ) : '' );
1414
+ return sprintf ("[ %s, '%s']( %s) " , $ this ->dumpValue ($ factory [0 ]), $ factory [1 ], implode (', ' , $ arguments ));
1415
1415
}
1416
1416
1417
1417
if ($ factory [0 ] instanceof Reference) {
0 commit comments