Psr11Trait::has()   A
last analyzed

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 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
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
    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