Completed
Pull Request — develop (#42)
by A.
02:36
created

AppKernel::registerBundles()   B

Complexity

Conditions 3
Paths 4

Size

Total Lines 35
Code Lines 22

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 35
rs 8.8571
cc 3
eloc 22
nc 4
nop 0
1
<?php
2
3
/**
4
 * Copyright 2015 SURFnet B.V.
5
 *
6
 * Licensed under the Apache License, Version 2.0 (the "License");
7
 * you may not use this file except in compliance with the License.
8
 * You may obtain a copy of the License at
9
 *
10
 *     http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS,
14
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
 * See the License for the specific language governing permissions and
16
 * limitations under the License.
17
 */
18
19
use Symfony\Component\HttpKernel\Kernel;
20
use Symfony\Component\Config\Loader\LoaderInterface;
21
22
class AppKernel extends Kernel
23
{
24
    public function registerBundles()
25
    {
26
        $bundles = [
27
            // Framework
28
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
29
            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
30
            new Symfony\Bundle\TwigBundle\TwigBundle(),
31
            new Symfony\Bundle\MonologBundle\MonologBundle(),
32
            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
33
34
            // Dependencies
35
            new JMS\TranslationBundle\JMSTranslationBundle(),
36
            new Nelmio\SecurityBundle\NelmioSecurityBundle(),
37
            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
38
            new Surfnet\SamlBundle\SurfnetSamlBundle(),
39
40
            // Project
41
            new OpenConext\ProfileBundle\OpenConextProfileBundle(),
42
            new OpenConext\EngineBlockApiClientBundle\OpenConextEngineBlockApiClientBundle(),
43
        ];
44
45
        if (in_array($this->getEnvironment(), ['dev', 'test', 'acc'])) {
46
            $bundles[] = new JMS\DiExtraBundle\JMSDiExtraBundle($this);
47
            $bundles[] = new JMS\AopBundle\JMSAopBundle();
48
        }
49
50
        if (in_array($this->getEnvironment(), ['dev', 'test'])) {
51
            $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
52
            $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
53
            $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
54
            $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
55
        }
56
57
        return $bundles;
58
    }
59
60
    public function registerContainerConfiguration(LoaderInterface $loader)
61
    {
62
        $loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
63
    }
64
}
65