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

Psr11Trait::__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
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10
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 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