Completed
Push — master ( 779cd5...425bbb )
by Koen
03:03
created

MicroKernel::configureRoutes()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 2
eloc 7
nc 2
nop 1
dl 0
loc 12
rs 9.4285
1
<?php
2
3
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
4
use Symfony\Component\Config\Loader\LoaderInterface;
5
use Symfony\Component\DependencyInjection\ContainerBuilder;
6
use Symfony\Component\HttpKernel\Kernel;
7
use Symfony\Component\Routing\RouteCollectionBuilder;
8
9
/**
10
 * @author Koen Vinken <[email protected]>
11
 */
12
class MicroKernel extends Kernel
13
{
14
    use MicroKernelTrait;
15
16
    /*
17
     * {@inheritDoc}
18
     */
19
    public function registerBundles()
20
    {
21
        $bundles = array(
22
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
23
            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
24
            new Symfony\Bundle\TwigBundle\TwigBundle(),
25
            new AppBundle\AppBundle(),
26
        );
27
28
        if (in_array($this->getEnvironment(), array('dev', 'test'), true)) {
29
            $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
30
            $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
31
        }
32
33
        return $bundles;
34
    }
35
36
    /*
37
     * {@inheritDoc}
38
     */
39
    protected function configureRoutes(RouteCollectionBuilder $routes)
40
    {
41
        if (in_array($this->getEnvironment(), array('dev', 'test'), true)) {
42
            $routes->mount('/_wdt', $routes->import('@WebProfilerBundle/Resources/config/routing/wdt.xml'));
43
            $routes->mount(
44
                '/_profiler',
45
                $routes->import('@WebProfilerBundle/Resources/config/routing/profiler.xml')
46
            );
47
        }
48
49
        $routes->mount('/', $routes->import('@AppBundle/Controller', 'annotation'));
50
    }
51
52
    /*
53
     * {@inheritDoc}
54
     */
55
    protected function configureContainer(ContainerBuilder $c, LoaderInterface $loader)
0 ignored issues
show
Unused Code introduced by
The parameter $c is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
56
    {
57
        $loader->load(__DIR__ . '/config/config_' . $this->getEnvironment() . '.yml');
58
    }
59
}
60