Extension.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. * @internal since Symfony 7.1, to be deprecated in 8.1; use Symfony\Component\DependencyInjection\Extension\Extension instead
  18. */
  19. abstract class Extension extends BaseExtension
  20. {
  21. private array $annotatedClasses = [];
  22. /**
  23. * Gets the annotated classes to cache.
  24. *
  25. * @return string[]
  26. *
  27. * @deprecated since Symfony 7.1, to be removed in 8.0
  28. */
  29. public function getAnnotatedClassesToCompile(): array
  30. {
  31. trigger_deprecation('symfony/http-kernel', '7.1', 'The "%s()" method is deprecated since Symfony 7.1 and will be removed in 8.0.', __METHOD__);
  32. return $this->annotatedClasses;
  33. }
  34. /**
  35. * Adds annotated classes to the class cache.
  36. *
  37. * @param string[] $annotatedClasses An array of class patterns
  38. *
  39. * @deprecated since Symfony 7.1, to be removed in 8.0
  40. */
  41. public function addAnnotatedClassesToCompile(array $annotatedClasses): void
  42. {
  43. trigger_deprecation('symfony/http-kernel', '7.1', 'The "%s()" method is deprecated since Symfony 7.1 and will be removed in 8.0.', __METHOD__);
  44. $this->annotatedClasses = array_merge($this->annotatedClasses, $annotatedClasses);
  45. }
  46. }