Completed
Push — master ( a69311...5b5097 )
by Christian
02:43
created

FOSRestBundle   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 8

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 8
dl 0
loc 17
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A build() 0 9 1
1
<?php
2
3
/*
4
 * This file is part of the FOSRestBundle 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
12
namespace FOS\RestBundle;
13
14
use FOS\RestBundle\DependencyInjection\Compiler\ConfigurationCheckPass;
15
use FOS\RestBundle\DependencyInjection\Compiler\HandlerRegistryDecorationPass;
16
use FOS\RestBundle\DependencyInjection\Compiler\JMSFormErrorHandlerPass;
17
use FOS\RestBundle\DependencyInjection\Compiler\JMSHandlersPass;
18
use FOS\RestBundle\DependencyInjection\Compiler\FormatListenerRulesPass;
19
use FOS\RestBundle\DependencyInjection\Compiler\SerializerConfigurationPass;
20
use Symfony\Component\DependencyInjection\ContainerBuilder;
21
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
22
use Symfony\Component\HttpKernel\Bundle\Bundle;
23
24
/**
25
 * @author Lukas Kahwe Smith <[email protected]>
26
 * @author Eriksen Costa <[email protected]>
27
 */
28
class FOSRestBundle extends Bundle
29
{
30
    const ZONE_ATTRIBUTE = '_fos_rest_zone';
31
32
    /**
33
     * {@inheritdoc}
34
     */
35 13
    public function build(ContainerBuilder $container)
36
    {
37 13
        $container->addCompilerPass(new SerializerConfigurationPass());
38 13
        $container->addCompilerPass(new ConfigurationCheckPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, -10);
39 13
        $container->addCompilerPass(new FormatListenerRulesPass());
40 13
        $container->addCompilerPass(new JMSFormErrorHandlerPass());
41 13
        $container->addCompilerPass(new JMSHandlersPass(), PassConfig::TYPE_BEFORE_REMOVING, -10);
42 13
        $container->addCompilerPass(new HandlerRegistryDecorationPass(), PassConfig::TYPE_AFTER_REMOVING);
43 13
    }
44
}
45