File tree 1 file changed +10
-2
lines changed
src/Symfony/Component/Validator/DependencyInjection
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -49,11 +49,19 @@ 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
+ if (!$ container ->hasDefinition ($ arguments [0 ])) {
58
+ continue ;
59
+ }
60
+
61
+ $ translator = $ container ->findDefinition ($ arguments [0 ]);
62
+ } else {
63
+ $ translator = $ arguments [0 ];
64
+ }
57
65
58
66
while (!($ class = $ translator ->getClass ()) && $ translator instanceof ChildDefinition) {
59
67
$ translator = $ translator ->getParent ();
You can’t perform that action at this time.
0 commit comments