Completed
Pull Request — develop (#107)
by
unknown
05:31
created

AppKernel   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 21

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 21
dl 0
loc 45
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A registerBundles() 0 37 3
A registerContainerConfiguration() 0 4 1
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
            new OpenConext\MonitorBundle\OpenConextMonitorBundle(),
40
41
            // Project
42
            new OpenConext\ProfileBundle\OpenConextProfileBundle(),
43
            new OpenConext\EngineBlockApiClientBundle\OpenConextEngineBlockApiClientBundle(),
44
            new OpenConext\AttributeAggregationApiClientBundle\OpenConextAttributeAggregationApiClientBundle(),
45
        ];
46
47
        if (in_array($this->getEnvironment(), ['dev', 'test', 'acc'])) {
48
            $bundles[] = new JMS\DiExtraBundle\JMSDiExtraBundle($this);
49
            $bundles[] = new JMS\AopBundle\JMSAopBundle();
50
        }
51
52
        if (in_array($this->getEnvironment(), ['dev', 'test'])) {
53
            $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
54
            $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
55
            $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
56
            $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
57
        }
58
59
        return $bundles;
60
    }
61
62
    public function registerContainerConfiguration(LoaderInterface $loader)
63
    {
64
        $loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
65
    }
66
}
67