You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Container.php
+45-35Lines changed: 45 additions & 35 deletions
Original file line number
Diff line number
Diff line change
@@ -55,6 +55,7 @@ class Container implements ResettableContainerInterface
55
55
protected$parameterBag;
56
56
57
57
protected$services = array();
58
+
protected$fileMap = array();
58
59
protected$methodMap = array();
59
60
protected$aliases = array();
60
61
protected$loading = array();
@@ -203,7 +204,7 @@ public function set($id, $service)
203
204
} else {
204
205
@trigger_error(sprintf('Setting the "%s" private service is deprecated since Symfony 3.2 and won\'t be supported anymore in Symfony 4.0.', $id), E_USER_DEPRECATED);
@trigger_error(sprintf('Unsetting the "%s" pre-defined service is deprecated since Symfony 3.3 and won\'t be supported anymore in Symfony 4.0.', $id), E_USER_DEPRECATED);
209
210
} else {
@@ -235,7 +236,7 @@ public function has($id)
235
236
returntrue;
236
237
}
237
238
238
-
if (isset($this->methodMap[$id])) {
239
+
if (isset($this->fileMap[$id]) || isset($this->methodMap[$id])) {
239
240
returntrue;
240
241
}
241
242
@@ -299,49 +300,48 @@ public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE
// We only check the convention-based factory in a compiled container (i.e. a child class other than a ContainerBuilder,
309
-
// and only when the dumper has not generated the method map (otherwise the method map is considered to be fully populated by the dumper)
310
-
@trigger_error('Generating a dumped container without populating the method map is deprecated since 3.2 and will be unsupported in 4.0. Update your dumper to generate the method map.', E_USER_DEPRECATED);
311
-
// $method is set to the right value, proceed
312
-
} else {
313
-
if (self::EXCEPTION_ON_INVALID_REFERENCE === $invalidBehavior) {
// We only check the convention-based factory in a compiled container (i.e. a child class other than a ContainerBuilder,
315
+
// and only when the dumper has not generated the method map (otherwise the method map is considered to be fully populated by the dumper)
316
+
@trigger_error('Generating a dumped container without populating the method map is deprecated since 3.2 and will be unsupported in 4.0. Update your dumper to generate the method map.', E_USER_DEPRECATED);
317
+
318
+
return$this->{$method}();
319
+
}
320
+
321
+
break;
336
322
} catch (\Exception$e) {
337
323
unset($this->services[$id]);
338
324
339
325
throw$e;
340
326
} finally {
341
327
unset($this->loading[$id]);
342
328
}
329
+
}
330
+
331
+
if (self::EXCEPTION_ON_INVALID_REFERENCE === $invalidBehavior) {
0 commit comments