TInjectionAware::setDI()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Anax\DI;
4
5
/**
6
 * Trait to use for DI aware services to let them know of the current $di
7
 *
8
 */
9
trait TInjectionAware
10
{
11
12
    /**
13
     * Properties
14
     */
15
    protected $di; // the service container
16
17
    /**
18
     * Set the service container to use
19
     *
20
     * @param class $di a service container
21
     *
22
     * @return $this
23
     */
24 2
    public function setDI($di)
25
    {
26 2
        $this->di = $di;
27 2
    }
28
}
29