You are here

class AddClassesToCachePass in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-kernel/DependencyInjection/AddClassesToCachePass.php \Symfony\Component\HttpKernel\DependencyInjection\AddClassesToCachePass

Sets the classes to compile in the cache for the container.

@author Fabien Potencier <fabien@symfony.com>

Hierarchy

Expanded class hierarchy of AddClassesToCachePass

1 file declares its use of AddClassesToCachePass
Kernel.php in vendor/symfony/http-kernel/Kernel.php

File

vendor/symfony/http-kernel/DependencyInjection/AddClassesToCachePass.php, line 23

Namespace

Symfony\Component\HttpKernel\DependencyInjection
View source
class AddClassesToCachePass implements CompilerPassInterface {
  private $kernel;
  public function __construct(Kernel $kernel) {
    $this->kernel = $kernel;
  }

  /**
   * {@inheritdoc}
   */
  public function process(ContainerBuilder $container) {
    $classes = array();
    foreach ($container
      ->getExtensions() as $extension) {
      if ($extension instanceof Extension) {
        $classes = array_merge($classes, $extension
          ->getClassesToCompile());
      }
    }
    $this->kernel
      ->setClassCache(array_unique($container
      ->getParameterBag()
      ->resolveValue($classes)));
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AddClassesToCachePass::$kernel private property
AddClassesToCachePass::process public function You can modify the container here before it is dumped to PHP code. Overrides CompilerPassInterface::process
AddClassesToCachePass::__construct public function