File tree 1 file changed +8
-2
lines changed
src/Symfony/Component/Validator/DependencyInjection 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -49,11 +49,17 @@ public function process(ContainerBuilder $container)
49
49
50
50
// @deprecated logic, to be removed in Symfony 5.0
51
51
$ builder = $ container ->getDefinition ($ this ->builderService );
52
- $ calls = [] ;
52
+ $ calls = array () ;
53
53
54
54
foreach ($ builder ->getMethodCalls () as list ($ method , $ arguments )) {
55
55
if ('setTranslator ' === $ method ) {
56
- $ translator = $ arguments [0 ] instanceof Reference ? $ container ->findDefinition ($ arguments [0 ]) : $ arguments [0 ];
56
+ if (!$ arguments [0 ] instanceof Reference) {
57
+ $ translator = $ arguments [0 ];
58
+ } elseif ($ container ->has ($ arguments [0 ])) {
59
+ $ translator = $ container ->findDefinition ($ arguments [0 ]);
60
+ } else {
61
+ continue ;
62
+ }
57
63
58
64
while (!($ class = $ translator ->getClass ()) && $ translator instanceof ChildDefinition) {
59
65
$ translator = $ translator ->getParent ();
You can’t perform that action at this time.
0 commit comments