vendor/friendsofsymfony/oauth-server-bundle/FOSOAuthServerBundle.php line 25

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. /*
  4.  * This file is part of the FOSOAuthServerBundle package.
  5.  *
  6.  * (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
  7.  *
  8.  * For the full copyright and license information, please view the LICENSE
  9.  * file that was distributed with this source code.
  10.  */
  11. namespace FOS\OAuthServerBundle;
  12. use FOS\OAuthServerBundle\DependencyInjection\Compiler\GrantExtensionsCompilerPass;
  13. use FOS\OAuthServerBundle\DependencyInjection\Compiler\RequestStackCompilerPass;
  14. use FOS\OAuthServerBundle\DependencyInjection\Compiler\TokenStorageCompilerPass;
  15. use FOS\OAuthServerBundle\DependencyInjection\FOSOAuthServerExtension;
  16. use FOS\OAuthServerBundle\DependencyInjection\Security\Factory\OAuthFactory;
  17. use Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension;
  18. use Symfony\Component\DependencyInjection\ContainerBuilder;
  19. use Symfony\Component\HttpKernel\Bundle\Bundle;
  20. class FOSOAuthServerBundle extends Bundle
  21. {
  22.     public function __construct()
  23.     {
  24.         $this->extension = new FOSOAuthServerExtension();
  25.     }
  26.     public function build(ContainerBuilder $container)
  27.     {
  28.         parent::build($container);
  29.         /** @var SecurityExtension $extension */
  30.         $extension $container->getExtension('security');
  31.         $extension->addSecurityListenerFactory(new OAuthFactory());
  32.         $container->addCompilerPass(new GrantExtensionsCompilerPass());
  33.         $container->addCompilerPass(new TokenStorageCompilerPass());
  34.         $container->addCompilerPass(new RequestStackCompilerPass());
  35.     }
  36. }