InjectableTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 0
cbo 0
dl 0
loc 30
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setDi() 0 5 1
A getDi() 0 4 1
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
}