vendor/symfony/swiftmailer-bundle/SwiftmailerBundle.php line 24

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\Bundle\SwiftmailerBundle;
  11. use Symfony\Bundle\SwiftmailerBundle\DependencyInjection\Compiler\EnsureNoHotPathPass;
  12. use Symfony\Bundle\SwiftmailerBundle\DependencyInjection\Compiler\RegisterPluginsPass;
  13. use Symfony\Component\Console\Application;
  14. use Symfony\Component\DependencyInjection\Compiler\PassConfig;
  15. use Symfony\Component\DependencyInjection\ContainerBuilder;
  16. use Symfony\Component\HttpKernel\Bundle\Bundle;
  17. /**
  18. * @author Fabien Potencier <fabien@symfony.com>
  19. */
  20. class SwiftmailerBundle extends Bundle
  21. {
  22. public function build(ContainerBuilder $container)
  23. {
  24. parent::build($container);
  25. $container->addCompilerPass(new RegisterPluginsPass());
  26. // Older supported versions of Symfony don't have the parent class that EnsureNoHotPathPass extends from.
  27. // But they don't have the hot_path optimization either, so not being able to register our pass is not an issue.
  28. if (class_exists('Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass')) {
  29. $container->addCompilerPass(new EnsureNoHotPathPass(), PassConfig::TYPE_AFTER_REMOVING);
  30. }
  31. }
  32. public function registerCommands(Application $application)
  33. {
  34. // noop
  35. }
  36. }