KernelDictionary::getContainer()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
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