Skip to content

Commit

Permalink
Update KernelPass.php
Browse files Browse the repository at this point in the history
  • Loading branch information
andrerom authored Oct 31, 2017
1 parent a61dea2 commit e5f7381
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/DependencyInjection/Compiler/KernelPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,18 @@ public function process(ContainerBuilder $container)
$container->removeAlias('ezpublish.http_cache.purger');
$arguments = $container->getDefinition('cache_clearer')->getArguments();

// BC Symfony < 3.4
if (is_array($arguments[0])) {
$arguments[0] = array_values(array_filter($arguments[0], function ($argument) {
if ($this->isCachePurger($argument)) {
return false;
}
return true;
}));
$container->getDefinition('cache_clearer')->setArguments($arguments);
// BC Symfony < 3.4, as of 3.4 and up handles this itself, on lower versions we need to adjust the arguments manually
if (!is_array($arguments[0])) {
return;
}

$arguments[0] = array_values(array_filter($arguments[0], function ($argument) {
if ($this->isCachePurger($argument)) {
return false;
}
return true;
}));
$container->getDefinition('cache_clearer')->setArguments($arguments);
}

/**
Expand Down

0 comments on commit e5f7381

Please sign in to comment.