Passed
Push — master ( 5d2a5f...85042a )
by Enrico
02:59
created

ContainerAwareTrait::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
/*
4
 * This file is part of the uSilex framework.
5
 *
6
 * (c) Enrico Fagnoni <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace uSilex;
13
14
use Psr\Container\ContainerInterface;
15
use Pimple\Container as PimpleContainer;
16
17
18
/**
19
 * Psr11 trait. Realize a Container aware interfce from a pimple container
20
 *
21
 * @author Enrico Fagnoni <[email protected]>
22
 */
23
trait ContainerAwareTrait
24
{
25
    private $container;
26
    
27 1
    public function __construct(ContainerInterface $container = null)
28
    {
29 1
        $this->container = $container;
30 1
    }
31
    
32 1
    public function getContainer() : ContainerInterface 
33
    {
34 1
        return $this->container;
35
    }
36
    
37
    
38 1
    public function setContainer(ContainerInterface $container) : self 
39
    {
40 1
        $this->container = $container;
41
        
42 1
        return $this;
43
    }
44
}
45