vendor/lexik/jwt-authentication-bundle/LexikJWTAuthenticationBundle.php line 33

Open in your IDE?
  1. <?php
  2. namespace Lexik\Bundle\JWTAuthenticationBundle;
  3. use Lexik\Bundle\JWTAuthenticationBundle\DependencyInjection\Compiler\WireGenerateTokenCommandPass;
  4. use Lexik\Bundle\JWTAuthenticationBundle\DependencyInjection\Security\Factory\JWTFactory;
  5. use Lexik\Bundle\JWTAuthenticationBundle\DependencyInjection\Security\Factory\JWTUserFactory;
  6. use Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension;
  7. use Symfony\Component\Console\Application;
  8. use Symfony\Component\DependencyInjection\ContainerBuilder;
  9. use Symfony\Component\HttpKernel\Bundle\Bundle;
  10. /**
  11.  * LexikJWTAuthenticationBundle.
  12.  *
  13.  * @author Nicolas Cabot <n.cabot@lexik.fr>
  14.  */
  15. class LexikJWTAuthenticationBundle extends Bundle
  16. {
  17.     /**
  18.      * {@inheritdoc}
  19.      */
  20.     public function build(ContainerBuilder $container)
  21.     {
  22.         parent::build($container);
  23.         $container->addCompilerPass(new WireGenerateTokenCommandPass());
  24.         /** @var SecurityExtension $extension */
  25.         $extension $container->getExtension('security');
  26.         $extension->addUserProviderFactory(new JWTUserFactory());
  27.         $extension->addSecurityListenerFactory(new JWTFactory()); // BC 1.x, to be removed in 3.0
  28.     }
  29.     /**
  30.      * {@inheritdoc}
  31.      */
  32.     public function registerCommands(Application $application)
  33.     {
  34.         // noop
  35.     }
  36. }