KernelDictionary   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 34
rs 10
c 1
b 0
f 0
wmc 3
lcom 1
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setKernel() 0 4 1
A getKernel() 0 4 1
A getContainer() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the Behat Symfony2Extension
5
 *
6
 * (c) Konstantin Kudryashov <[email protected]>
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
namespace Behat\Symfony2Extension\Context;
13
14
use Symfony\Component\HttpKernel\KernelInterface;
15
use Symfony\Component\DependencyInjection\ContainerInterface;
16
17
/**
18
 * Kernel support methods for Symfony2Extension.
19
 *
20
 * @author Konstantin Kudryashov <[email protected]>
21
 */
22
trait KernelDictionary
23
{
24
    private $kernel;
25
26
    /**
27
     * Sets Kernel instance.
28
     *
29
     * @param KernelInterface $kernel
30
     */
31
    public function setKernel(KernelInterface $kernel)
32
    {
33
        $this->kernel = $kernel;
34
    }
35
36
    /**
37
     * Returns HttpKernel instance.
38
     *
39
     * @return KernelInterface
40
     */
41
    public function getKernel()
42
    {
43
        return $this->kernel;
44
    }
45
46
    /**
47
     * Returns HttpKernel service container.
48
     *
49
     * @return ContainerInterface
50
     */
51
    public function getContainer()
52
    {
53
        return $this->kernel->getContainer();
54
    }
55
}
56