1 | <?php |
||
2 | |||
3 | /* |
||
4 | * @copyright 2014 Mautic Contributors. All rights reserved |
||
5 | * @author Mautic |
||
6 | * |
||
7 | * @link http://mautic.org |
||
8 | * |
||
9 | * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html |
||
10 | */ |
||
11 | |||
12 | namespace Mautic\ApiBundle; |
||
13 | |||
14 | use Mautic\ApiBundle\DependencyInjection\Compiler\OAuthPass; |
||
15 | use Mautic\ApiBundle\DependencyInjection\Compiler\SerializerPass; |
||
16 | use Mautic\ApiBundle\DependencyInjection\Factory\ApiFactory; |
||
17 | use Symfony\Component\DependencyInjection\ContainerBuilder; |
||
18 | use Symfony\Component\HttpKernel\Bundle\Bundle; |
||
19 | |||
20 | /** |
||
21 | * Class MauticApiBundle. |
||
22 | */ |
||
23 | class MauticApiBundle extends Bundle |
||
24 | { |
||
25 | /** |
||
26 | * {@inheritdoc} |
||
27 | */ |
||
28 | public function build(ContainerBuilder $container) |
||
29 | { |
||
30 | parent::build($container); |
||
31 | |||
32 | $container->addCompilerPass(new OAuthPass()); |
||
33 | $container->addCompilerPass(new SerializerPass()); |
||
34 | |||
35 | $extension = $container->getExtension('security'); |
||
36 | $extension->addSecurityListenerFactory(new ApiFactory()); |
||
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
37 | } |
||
38 | |||
39 | /** |
||
40 | * {@inheritdoc} |
||
41 | */ |
||
42 | public function getParent() |
||
43 | { |
||
44 | return 'FOSOAuthServerBundle'; |
||
45 | } |
||
46 | } |
||
47 |