Passed
Push — master ( 863ad3...126876 )
by Enrico
02:01
created

Psr11Trait   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
eloc 5
dl 0
loc 18
c 0
b 0
f 0
ccs 7
cts 7
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A get() 0 3 1
A has() 0 3 1
A __construct() 0 3 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 Pimple\Container as PimpleContainer;
15
16
/**
17
 * Psr11 trait. Add a Container interface implementation using Pimple
18
 *
19
 * @author Enrico Fagnoni <[email protected]>
20
 */
21
trait Psr11Trait
22
{
23
        
24
    private $pimple;
25
    
26 1
    public function __construct(PimpleContainer $pimple)
27
    {
28 1
        $this->pimple = $pimple;
29 1
    }
30
    
31 1
    public function get($id)
32
    {
33 1
        return $this->pimple[$id];
34
    }
35
    
36 1
    public function has($id)
37
    {
38 1
        return isset($this->pimple[$id]);
39
    }
40
    
41
}
42