4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\HttpKernel\DependencyInjection;
14 use Symfony\Component\DependencyInjection\ContainerBuilder;
15 use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
16 use Symfony\Component\HttpKernel\Kernel;
19 * Sets the classes to compile in the cache for the container.
21 * @author Fabien Potencier <fabien@symfony.com>
23 class AddClassesToCachePass implements CompilerPassInterface
27 public function __construct(Kernel $kernel)
29 $this->kernel = $kernel;
35 public function process(ContainerBuilder $container)
38 foreach ($container->getExtensions() as $extension) {
39 if ($extension instanceof Extension) {
40 $classes = array_merge($classes, $extension->getClassesToCompile());
44 $this->kernel->setClassCache(array_unique($container->getParameterBag()->resolveValue($classes)));