for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of php-cache\cache-bundle package.
*
* (c) 2015 Aaron Scherer <[email protected]>, Tobias Nyholm <[email protected]>
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Cache\CacheBundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
/**
* Make sure to tag all cache services we can find.
* @author Tobias Nyholm <[email protected]>
class CacheTaggingPass implements CompilerPassInterface
{
* {@inheritdoc}
public function process(ContainerBuilder $container)
// get service ids form parameters
$serviceIds = $container->getParameter('cache.provider_service_ids');
foreach ($serviceIds as $id) {
$def = $container->findDefinition($id);
if (!$def->hasTag('cache.provider')) {
$def->addTag('cache.provider');
}