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

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\FOSOAuthServerExtension;
  15. use FOS\OAuthServerBundle\DependencyInjection\Security\Factory\OAuthFactory;
  16. use Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension;
  17. use Symfony\Component\DependencyInjection\ContainerBuilder;
  18. use Symfony\Component\HttpKernel\Bundle\Bundle;
  19. class FOSOAuthServerBundle extends Bundle
  20. {
  21.     public function __construct()
  22.     {
  23.         $this->extension = new FOSOAuthServerExtension();
  24.     }
  25.     public function build(ContainerBuilder $container)
  26.     {
  27.         parent::build($container);
  28.         /** @var SecurityExtension $extension */
  29.         $extension $container->getExtension('security');
  30.         $extension->addSecurityListenerFactory(new OAuthFactory());
  31.         $container->addCompilerPass(new GrantExtensionsCompilerPass());
  32.         $container->addCompilerPass(new RequestStackCompilerPass());
  33.     }
  34. }