Completed
Push — master ( 00f21d...76f138 )
by Boy
19:52 queued 16:05
created

AppKernel   C

Complexity

Total Complexity 3

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 29

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 3
c 2
b 0
f 1
lcom 1
cbo 29
dl 0
loc 45
rs 5

2 Methods

Rating   Name   Duplication   Size   Complexity  
A registerContainerConfiguration() 0 4 1
B registerBundles() 0 37 2
1
<?php
2
3
/**
4
 * Copyright 2014 SURFnet bv
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\Config\Loader\LoaderInterface;
20
use Symfony\Component\HttpKernel\Kernel;
21
22
class AppKernel extends Kernel
23
{
24
    public function registerBundles()
25
    {
26
        $bundles = array(
27
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
28
            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
29
            new Symfony\Bundle\TwigBundle\TwigBundle(),
30
            new Symfony\Bundle\MonologBundle\MonologBundle(),
31
            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
32
            new Symfony\Bundle\AsseticBundle\AsseticBundle(),
33
            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
34
            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
35
            new Surfnet\StepupGateway\ApiBundle\SurfnetStepupGatewayApiBundle(),
36
            new Nelmio\SecurityBundle\NelmioSecurityBundle(),
37
            new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
38
            new Mopa\Bundle\BootstrapBundle\MopaBootstrapBundle(),
39
            new Surfnet\MessageBirdApiClientBundle\SurfnetMessageBirdApiClientBundle(),
40
            new Surfnet\YubikeyApiClientBundle\SurfnetYubikeyApiClientBundle(),
41
            new Surfnet\StepupBundle\SurfnetStepupBundle(),
42
            new Surfnet\StepupGateway\GatewayBundle\SurfnetStepupGatewayGatewayBundle(),
43
            new Surfnet\SamlBundle\SurfnetSamlBundle(),
44
            new JMS\TranslationBundle\JMSTranslationBundle(),
45
            new JMS\DiExtraBundle\JMSDiExtraBundle($this),
46
            new JMS\AopBundle\JMSAopBundle(),
47
            new Surfnet\StepupGateway\SamlStepupProviderBundle\SurfnetStepupGatewaySamlStepupProviderBundle(),
48
            new Surfnet\StepupGateway\SecondFactorOnlyBundle\SurfnetStepupGatewaySecondFactorOnlyBundle(),
49
            new Surfnet\StepupGateway\U2fVerificationBundle\SurfnetStepupGatewayU2fVerificationBundle(),
50
            new Surfnet\StepupU2fBundle\SurfnetStepupU2fBundle(),
51
        );
52
53
        if (in_array($this->getEnvironment(), array('dev', 'test'))) {
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(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
65
    }
66
}
67