8000 [DI] fix synthetic services in ResolveNoPreloadPass · symfony/symfony@b2d1ec5 · GitHub
[go: up one dir, main page]

Skip to content

Commit b2d1ec5

Browse files
[DI] fix synthetic services in ResolveNoPreloadPass
1 parent 75e3d75 commit b2d1ec5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Symfony/Component/DependencyInjection/Compiler/ResolveNoPreloadPass.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function process(ContainerBuilder $container)
4848
}
4949

5050
foreach ($container->getAliases() as $alias) {
51-
if ($alias->isPublic() && !$alias->isPrivate() && !isset($this->resolvedIds[$id = (string) $alias]) && $container->has($id)) {
51+
if ($alias->isPublic() && !$alias->isPrivate() && !isset($this->resolvedIds[$id = (string) $alias]) && $container->hasDefinition($id)) {
5252
$this->resolvedIds[$id] = true;
5353
$this->processValue($container->getDefinition($id), true);
5454
}
@@ -72,8 +72,8 @@ public function process(ContainerBuilder $container)
7272
*/
7373
protected function processValue($value, bool $isRoot = false)
7474
{
75-
if ($value instanceof Reference && ContainerBuilder::IGNORE_ON_UNINITIALIZED_REFERENCE !== $value->getInvalidBehavior() && $this->container->has($id = (string) $value)) {
76-
$definition = $this->container->findDefinition($id);
75+
if ($value instanceof Reference && ContainerBuilder::IGNORE_ON_UNINITIALIZED_REFERENCE !== $value->getInvalidBehavior() && $this->container->hasDefinition($id = (string) $value)) {
76+
$definition = $this->container->getDefinition($id);
7777

7878
if (!isset($this->resolvedIds[$id]) && (!$definition->isPublic() || $definition->isPrivate())) {
7979
$this->resolvedIds[$id] = true;

0 commit comments

Comments
 (0)
0