Skip to content

Commit 41f3d1f

Browse files
committed
Use findDefinition() instead of getDefinition() after calling has()
1 parent f04c0b5 commit 41f3d1f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CachePoolClearerPass.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ public function process(ContainerBuilder $container)
5656
return;
5757
}
5858
$factory = array(AbstractAdapter::class, 'createSystemCache');
59-
$annotationsPool = $container->getDefinition('cache.annotations');
59+
$annotationsPool = $container->findDefinition('cache.annotations');
6060
if ($factory !== $annotationsPool->getFactory() || 4 !== count($annotationsPool->getArguments())) {
6161
return;
6262
}
6363
if ($container->has('monolog.logger.cache')) {
6464
$annotationsPool->addArgument(new Reference('monolog.logger.cache'));
6565
} elseif ($container->has('cache.system')) {
66-
$systemPool = $container->getDefinition('cache.system');
66+
$systemPool = $container->findDefinition('cache.system');
6767
if ($factory === $systemPool->getFactory() && 5 <= count($systemArgs = $systemPool->getArguments())) {
6868
$annotationsPool->addArgument($systemArgs[4]);
6969
}

0 commit comments

Comments
 (0)