Completed
Pull Request — develop (#639)
by Narcotic
18:41 queued 12:22
created

GravitonCoreBundle::build()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

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 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * core infrastructure like logging and framework.
4
 */
5
6
namespace Graviton\CoreBundle;
7
8
use Graviton\BundleBundle\GravitonBundleInterface;
9
use Graviton\CacheBundle\GravitonCacheBundle;
10
use Graviton\CoreBundle\Compiler\EnvParametersCompilerPass;
11
use Graviton\DocumentBundle\GravitonDocumentBundle;
12
use Graviton\ExceptionBundle\GravitonExceptionBundle;
13
use Graviton\GeneratorBundle\GravitonGeneratorBundle;
14
use Graviton\I18nBundle\GravitonI18nBundle;
15
use Graviton\LogBundle\GravitonLogBundle;
16
use Graviton\RabbitMqBundle\GravitonRabbitMqBundle;
17
use Graviton\ProxyBundle\GravitonProxyBundle;
18
use Graviton\RestBundle\GravitonRestBundle;
19
use Graviton\SchemaBundle\GravitonSchemaBundle;
20
use Graviton\SecurityBundle\GravitonSecurityBundle;
21
use Graviton\SwaggerBundle\GravitonSwaggerBundle;
22
use Graviton\FileBundle\GravitonFileBundle;
23
use Graviton\MigrationBundle\GravitonMigrationBundle;
24
use Symfony\Component\HttpKernel\Bundle\Bundle;
25
use Graviton\CoreBundle\Compiler\VersionCompilerPass;
26
use Symfony\Component\DependencyInjection\ContainerBuilder;
27
28
/**
29
 * GravitonCoreBundle
30
 *
31
 * @author   List of contributors <https://github.com/libgraviton/graviton/graphs/contributors>
32
 * @license  https://opensource.org/licenses/MIT MIT License
33
 * @link     http://swisscom.ch
34
 */
35
class GravitonCoreBundle extends Bundle implements GravitonBundleInterface
36
{
37
    /**
38
     * {@inheritDoc}
39
     *
40
     * set up graviton symfony bundles
41
     *
42
     * @return \Symfony\Component\HttpKernel\Bundle\Bundle[]
0 ignored issues
show
Documentation introduced by
Consider making the return type a bit more specific; maybe use array<GravitonExceptionB...le|GravitonProxyBundle>.

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...
43
     */
44 8
    public function getBundles()
45
    {
46
        return array(
47 8
            new GravitonExceptionBundle(),
48 8
            new GravitonDocumentBundle(),
49 8
            new GravitonSchemaBundle(),
50 8
            new GravitonRestBundle(),
51 8
            new GravitonI18nBundle(),
52 8
            new GravitonGeneratorBundle(),
53 8
            new GravitonCacheBundle(),
54 8
            new GravitonLogBundle(),
55 8
            new GravitonSecurityBundle(),
56 8
            new GravitonSwaggerBundle(),
57 8
            new GravitonFileBundle(),
58 8
            new GravitonRabbitMqBundle(),
59 8
            new GravitonMigrationBundle(),
60 8
            new GravitonProxyBundle(),
61
        );
62
    }
63
64
    /**
65
     * load version compiler pass
66
     *
67
     * @param ContainerBuilder $container container builder
68
     *
69
     * @return void
70
     */
71 2
    public function build(ContainerBuilder $container)
72
    {
73 2
        parent::build($container);
74
75 2
        $container->addCompilerPass(new VersionCompilerPass());
76 2
        $container->addCompilerPass(new EnvParametersCompilerPass());
77 2
    }
78
}
79