vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/Extension.php line 62

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the Symfony package.
  4.  *
  5.  * (c) Fabien Potencier <fabien@symfony.com>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace Symfony\Component\HttpKernel\DependencyInjection;
  11. use Symfony\Component\DependencyInjection\Extension\Extension as BaseExtension;
  12. /**
  13.  * Allow adding classes to the class cache.
  14.  *
  15.  * @author Fabien Potencier <fabien@symfony.com>
  16.  */
  17. abstract class Extension extends BaseExtension
  18. {
  19.     private $classes = [];
  20.     private $annotatedClasses = [];
  21.     /**
  22.      * Gets the classes to cache.
  23.      *
  24.      * @return array An array of classes
  25.      *
  26.      * @deprecated since version 3.3, to be removed in 4.0.
  27.      */
  28.     public function getClassesToCompile()
  29.     {
  30.         if (\PHP_VERSION_ID >= 70000) {
  31.             @trigger_error(__METHOD__.'() is deprecated since Symfony 3.3, to be removed in 4.0.'E_USER_DEPRECATED);
  32.         }
  33.         return $this->classes;
  34.     }
  35.     /**
  36.      * Gets the annotated classes to cache.
  37.      *
  38.      * @return array An array of classes
  39.      */
  40.     public function getAnnotatedClassesToCompile()
  41.     {
  42.         return $this->annotatedClasses;
  43.     }
  44.     /**
  45.      * Adds classes to the class cache.
  46.      *
  47.      * @param array $classes An array of class patterns
  48.      *
  49.      * @deprecated since version 3.3, to be removed in 4.0.
  50.      */
  51.     public function addClassesToCompile(array $classes)
  52.     {
  53.         if (\PHP_VERSION_ID >= 70000) {
  54.             @trigger_error(__METHOD__.'() is deprecated since Symfony 3.3, to be removed in 4.0.'E_USER_DEPRECATED);
  55.         }
  56.         $this->classes array_merge($this->classes$classes);
  57.     }
  58.     /**
  59.      * Adds annotated classes to the class cache.
  60.      *
  61.      * @param array $annotatedClasses An array of class patterns
  62.      */
  63.     public function addAnnotatedClassesToCompile(array $annotatedClasses)
  64.     {
  65.         $this->annotatedClasses array_merge($this->annotatedClasses$annotatedClasses);
  66.     }
  67. }