Passed
Push — master ( e1417b...db188a )
by Alex
01:58
created

ContainerAwareTrait::getContainer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
/**
4
 * Codeburner Framework.
5
 *
6
 * @author Alex Rohleder <[email protected]>
7
 * @copyright 2015 Alex Rohleder
8
 * @license http://opensource.org/licenses/MIT
9
 */
10
11
namespace Codeburner\Container;
12
13
/**
14
 * Codeburner Container Component.
15
 *
16
 * @author Alex Rohleder <[email protected]>
17
 * @see https://github.com/codeburnerframework/container
18
 */
19
20
trait ContainerAwareTrait
21
{
22
23
    /**
24
     * The instance of container.
25
     *
26
     * @var ContainerInterface
27
     */
28
29
    protected $container;
30
31
    /**
32
     * Set a container.
33
     *
34
     * @param ContainerInterface $container
35
     * @return mixed
36
     */
37
38 1
    public function setContainer(ContainerInterface $container)
39
    {
40 1
        $this->container = $container;
41
42 1
        return $this;
43
    }
44
45
    /**
46
     * Get the container.
47
     *
48
     * @return ContainerInterface
49
     */
50
51 1
    public function getContainer()
52
    {
53 1
        return $this->container;
54
    }
55
56
}
57