ContainerAwareTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
dl 0
loc 37
c 1
b 1
f 0
wmc 2
lcom 0
cbo 0
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setContainer() 0 6 1
A getContainer() 0 4 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