Psr11Trait   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 5
c 1
b 0
f 0
dl 0
loc 17
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
    private $pimple;
24
    
25 1
    public function __construct(PimpleContainer $pimple)
26
    {
27 1
        $this->pimple = $pimple;
28 1
    }
29
    
30 1
    public function get($id)
31
    {
32 1
        return $this->pimple[$id];
33
    }
34
    
35 1
    public function has($id)
36
    {
37 1
        return isset($this->pimple[$id]);
38
    }
39
}
40