vendor/nelmio/security-bundle/NelmioSecurityBundle.php line 22

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the Nelmio SecurityBundle.
  4.  *
  5.  * (c) Nelmio <hello@nelm.io>
  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 Nelmio\SecurityBundle;
  11. use Nelmio\SecurityBundle\ContentSecurityPolicy\Violation\Events;
  12. use Nelmio\SecurityBundle\ContentSecurityPolicy\Violation\ReportEvent;
  13. use Nelmio\SecurityBundle\DependencyInjection\Compiler\CspReportFilterCompilerPass;
  14. use Nelmio\SecurityBundle\DependencyInjection\Compiler\UAParserCompilerPass;
  15. use Symfony\Component\EventDispatcher\DependencyInjection\AddEventAliasesPass;
  16. use Symfony\Component\HttpKernel\Bundle\Bundle;
  17. use Symfony\Component\DependencyInjection\ContainerBuilder;
  18. class NelmioSecurityBundle extends Bundle
  19. {
  20.     public function build(ContainerBuilder $container)
  21.     {
  22.         parent::build($container);
  23.         $container->addCompilerPass(new UAParserCompilerPass());
  24.         $container->addCompilerPass(new CspReportFilterCompilerPass());
  25.         if (class_exists(AddEventAliasesPass::class)) {
  26.             $container->addCompilerPass(new AddEventAliasesPass([
  27.                 ReportEvent::class => Events::VIOLATION_REPORT,
  28.             ]));
  29.         }
  30.     }
  31. }