Cancelled
Pull Request — master (#19)
by Wachter
05:00 queued 21s
created

AppKernel   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 4
dl 0
loc 42
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of Sulu.
5
 *
6
 * (c) MASSIVE ART WebServices GmbH
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
use Sulu\Bundle\CommentBundle\SuluCommentBundle;
13
use Sulu\Bundle\TestBundle\Kernel\SuluTestKernel;
14
use Symfony\Component\Config\Loader\LoaderInterface;
15
16
class AppKernel extends SuluTestKernel
17
{
18
    /**
19
     * {@inheritdoc}
20
     */
21
    public function __construct($environment, $debug, $suluContext = self::CONTEXT_ADMIN)
22
    {
23
        $this->name = $suluContext;
24
25
        parent::__construct($environment, $debug, $suluContext);
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31
    public function registerBundles()
32
    {
33
        $bundles = array_merge(
34
            [
35
                new SuluCommentBundle(),
36
            ],
37
            parent::registerBundles()
38
        );
39
40
        if ($this->getContext() !== self::CONTEXT_ADMIN) {
41
            $bundles[] = new \FOS\RestBundle\FOSRestBundle();
42
        }
43
44
        return $bundles;
45
    }
46
47
    /**
48
     * {@inheritdoc}
49
     */
50
    public function registerContainerConfiguration(LoaderInterface $loader)
51
    {
52
        parent::registerContainerConfiguration($loader);
53
54
        $context = $this->getContext();
55
        $loader->load(__DIR__ . '/config/config_' . $context . '.yml');
56
    }
57
}
58