8000 prevent calling get() for service_container service · symfony/symfony@64f8a7e · GitHub
[go: up one dir, main page]

Skip to content

Commit 64f8a7e

Browse files
committed
prevent calling get() for service_container service
1 parent cadcebf commit 64f8a7e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,10 @@ protected function resolveServiceDefinition(ContainerBuilder $builder, $serviceI
256256
return $builder->getAlias($serviceId);
257257
}
258258

259+
if ('service_container' === $serviceId) {
260+
return $builder;
261+
}
262+
259263
// the service has been injected in some special way, just return the service
260264
return $builder->get($serviceId);
261265
}

src/Symfony/Component/DependencyInjection/ContainerBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ public function has($id)
412412
public function get($id, $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE)
413413
{
414414
if (!$this->compiled) {
415-
@trigger_error(sprintf('Calling %s before compiling the container is deprecated since version 3.2 and will throw an exception in 4.0.', __METHOD__), E_USER_DEPRECATED);
415+
@trigger_error(sprintf('Calling %s() before compiling the container is deprecated since version 3.2 and will throw an exception in 4.0.', __METHOD__), E_USER_DEPRECATED);
416416
}
417417

418418
$id = strtolower($id);

0 commit comments

Comments
 (0)
0