GravitonRestBundle::build()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * GravitonRestBundle
4
 */
5
6
namespace Graviton\RestBundle;
7
8
use Symfony\Component\HttpKernel\Bundle\Bundle;
9
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
10
use Symfony\Component\DependencyInjection\ContainerBuilder;
11
use Graviton\BundleBundle\GravitonBundleInterface;
12
use JMS\SerializerBundle\JMSSerializerBundle;
13
use Misd\GuzzleBundle\MisdGuzzleBundle;
14
use Graviton\RestBundle\DependencyInjection\Compiler\RestServicesCompilerPass;
15
use Graviton\RestBundle\DependencyInjection\Compiler\RqlQueryDecoratorCompilerPass;
16
use Graviton\RestBundle\DependencyInjection\Compiler\RqlQueryRoutesCompilerPass;
17
18
/**
19
 * GravitonRestBundle
20
 *
21
 * @author   List of contributors <https://github.com/libgraviton/graviton/graphs/contributors>
22
 * @license  https://opensource.org/licenses/MIT MIT License
23
 * @link     http://swisscom.ch
24
 */
25
class GravitonRestBundle extends Bundle implements GravitonBundleInterface
26
{
27
    /**
28
     * {@inheritDoc}
29
     *
30
     * set up basic bundles needed for being RESTful
31
     *
32
     * @return \Symfony\Component\HttpKernel\Bundle\Bundle[]
0 ignored issues
show
Documentation introduced by
Consider making the return type a bit more specific; maybe use JMSSerializerBundle[].

This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.

Loading history...
33
     */
34 6
    public function getBundles()
35
    {
36
        return array(
37 6
            new JMSSerializerBundle(),
38
        );
39
    }
40
41
    /**
42
     * load compiler pass rest route loader
43
     *
44
     * @param ContainerBuilder $container container builder
45
     *
46
     * @return void
47
     */
48 4
    public function build(ContainerBuilder $container)
49
    {
50 4
        parent::build($container);
51
52 4
        $container->addCompilerPass(new RestServicesCompilerPass);
53 4
        $container->addCompilerPass(new RqlQueryRoutesCompilerPass());
54 4
    }
55
}
56