vendor/twig/extra-bundle/TwigExtraBundle.php line 30

Open in your IDE?
  1. <?php
  2. /*
  3. * This file is part of Twig.
  4. *
  5. * (c) Fabien Potencier
  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 Twig\Extra\TwigExtraBundle;
  11. use Symfony\Component\DependencyInjection\ContainerBuilder;
  12. use Symfony\Component\HttpKernel\Bundle\Bundle;
  13. use Symfony\Component\HttpKernel\KernelInterface;
  14. use Twig\Extra\TwigExtraBundle\DependencyInjection\Compiler\MissingExtensionSuggestorPass;
  15. if (method_exists(KernelInterface::class, 'getShareDir')) {
  16. class TwigExtraBundle extends Bundle
  17. {
  18. public function build(ContainerBuilder $container): void
  19. {
  20. parent::build($container);
  21. $container->addCompilerPass(new MissingExtensionSuggestorPass());
  22. }
  23. }
  24. } else {
  25. class TwigExtraBundle extends Bundle
  26. {
  27. /** @return void */
  28. public function build(ContainerBuilder $container)
  29. {
  30. parent::build($container);
  31. $container->addCompilerPass(new MissingExtensionSuggestorPass());
  32. }
  33. }
  34. }