From 41f3d1f1664e207edd6bf393ce7d00b51cfaa33c Mon Sep 17 00:00:00 2001 From: Robin Chalas Date: Tue, 11 Apr 2017 16:03:41 +0200 Subject: [PATCH] Use findDefinition() instead of getDefinition() after calling has() --- .../DependencyInjection/Compiler/CachePoolClearerPass.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CachePoolClearerPass.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CachePoolClearerPass.php index 591d03c58ae0..882f9b2dccf6 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CachePoolClearerPass.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CachePoolClearerPass.php @@ -56,14 +56,14 @@ public function process(ContainerBuilder $container) return; } $factory = array(AbstractAdapter::class, 'createSystemCache'); - $annotationsPool = $container->getDefinition('cache.annotations'); + $annotationsPool = $container->findDefinition('cache.annotations'); if ($factory !== $annotationsPool->getFactory() || 4 !== count($annotationsPool->getArguments())) { return; } if ($container->has('monolog.logger.cache')) { $annotationsPool->addArgument(new Reference('monolog.logger.cache')); } elseif ($container->has('cache.system')) { - $systemPool = $container->getDefinition('cache.system'); + $systemPool = $container->findDefinition('cache.system'); if ($factory === $systemPool->getFactory() && 5 <= count($systemArgs = $systemPool->getArguments())) { $annotationsPool->addArgument($systemArgs[4]); }