GravitonRestBundle   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 5
dl 0
loc 31
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getBundles() 0 6 1
A build() 0 7 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