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
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -231,17 +231,16 @@ public function has($id)
231
231
if ('service_container' === $id) {
232
232
returntrue;
233
233
}
234
+
if (isset($this->privates[$id])) {
235
+
@trigger_error(sprintf('Checking for the existence of the "%s" private service is deprecated since Symfony 3.2 and won\'t be supported anymore in Symfony 4.0.', $id), E_USER_DEPRECATED);
236
+
}
234
237
if (isset($this->aliases[$id])) {
235
238
$id = $this->aliases[$id];
236
239
}
237
240
if (isset($this->services[$id])) {
238
241
returntrue;
239
242
}
240
243
241
-
if (isset($this->privates[$id])) {
242
-
@trigger_error(sprintf('Checking for the existence of the "%s" private service is deprecated since Symfony 3.2 and won\'t be supported anymore in Symfony 4.0.', $id), E_USER_DEPRECATED);
243
-
}
244
-
245
244
if (isset($this->methodMap[$id])) {
246
245
returntrue;
247
246
}
@@ -293,6 +292,10 @@ public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE
293
292
if (isset($this->aliases[$id])) {
294
293
$id = $this->aliases[$id];
295
294
}
295
+
if (isset($this->privates[$id])) {
296
+
@trigger_error(sprintf('Requesting the "%s" private service is deprecated since Symfony 3.2 and won\'t be supported anymore in Symfony 4.0.', $id), E_USER_DEPRECATED);
297
+
}
298
+
296
299
// Re-use shared service instance if it exists.
297
300
if (isset($this->services[$id])) {
298
301
return$this->services[$id];
@@ -331,9 +334,6 @@ public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE
331
334
332
335
return;
333
336
}
334
-
if (isset($this->privates[$id])) {
335
-
@trigger_error(sprintf('Requesting the "%s" private service is deprecated since Symfony 3.2 and won\'t be supported anymore in Symfony 4.0.', $id), E_USER_DEPRECATED);
Copy file name to clipboardExpand all lines: Tests/ContainerTest.php
+17-4Lines changed: 17 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -147,7 +147,7 @@ public function testGetServiceIds()
147
147
148
148
$sc = newProjectServiceContainer();
149
149
$sc->set('foo', $obj = new \stdClass());
150
-
$this->assertEquals(array('service_container', 'internal', 'bar', 'foo_bar', 'foo.baz', 'circular', 'throw_exception', 'throws_exception_on_service_configuration', 'foo'), $sc->getServiceIds(), '->getServiceIds() returns defined service ids by factory methods in the method map, followed by service ids defined by set()');
150
+
$this->assertEquals(array('service_container', 'internal', 'bar', 'foo_bar', 'foo.baz', 'circular', 'throw_exception', 'throws_exception_on_service_configuration', 'internal_dependency', 'foo'), $sc->getServiceIds(), '->getServiceIds() returns defined service ids by factory methods in the method map, followed by service ids defined by set()');
151
151
}
152
152
153
153
/**
@@ -453,7 +453,8 @@ public function testUnsetInternalPrivateServiceIsDeprecated()
0 commit comments