vendor/scheb/two-factor-bundle/SchebTwoFactorBundle.php line 16

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Scheb\TwoFactorBundle;
  4. use Scheb\TwoFactorBundle\DependencyInjection\Compiler\AuthenticationProviderDecoratorCompilerPass;
  5. use Scheb\TwoFactorBundle\DependencyInjection\Compiler\RememberMeServicesDecoratorCompilerPass;
  6. use Scheb\TwoFactorBundle\DependencyInjection\Compiler\TwoFactorFirewallConfigCompilerPass;
  7. use Scheb\TwoFactorBundle\DependencyInjection\Compiler\TwoFactorProviderCompilerPass;
  8. use Scheb\TwoFactorBundle\DependencyInjection\Factory\Security\TwoFactorFactory;
  9. use Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension;
  10. use Symfony\Component\DependencyInjection\ContainerBuilder;
  11. use Symfony\Component\HttpKernel\Bundle\Bundle;
  12. class SchebTwoFactorBundle extends Bundle
  13. {
  14.     /**
  15.      * @return void
  16.      */
  17.     public function build(ContainerBuilder $container)
  18.     {
  19.         parent::build($container);
  20.         $container->addCompilerPass(new AuthenticationProviderDecoratorCompilerPass());
  21.         $container->addCompilerPass(new RememberMeServicesDecoratorCompilerPass());
  22.         $container->addCompilerPass(new TwoFactorProviderCompilerPass());
  23.         $container->addCompilerPass(new TwoFactorFirewallConfigCompilerPass());
  24.         /** @var SecurityExtension $extension */
  25.         $extension $container->getExtension('security');
  26.         $extension->addSecurityListenerFactory(new TwoFactorFactory());
  27.     }
  28. }