InjectableTrait::getDi()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
namespace Lebran\Container;
3
4
use Lebran\Container;
5
6
/**
7
 * It's trait help you realize InjectableInterface.
8
 *
9
 * @package    Container
10
 * @version    1.0
11
 * @author     Roman Kritskiy <[email protected]>
12
 * @license    MIT
13
 * @copyright  2015 - 2016 Roman Kritskiy
14
 */
15
trait InjectableTrait
16
{
17
    /**
18
     * @var Container Store for di container.
19
     */
20
    protected $di;
21
22
    /**
23
     * Sets the dependency injection container.
24
     *
25
     * @param Container $di Container object.
26
     *
27
     * @return $this
28
     */
29
    public function setDi(Container $di)
30
    {
31
        $this->di = $di;
32
        return $this;
33
    }
34
35
    /**
36
     * Returns the dependency injection container.
37
     *
38
     * @return Container object.
39
     */
40
    public function getDi()
41
    {
42
        return $this->di;
43
    }
44
}