Total Complexity | 7 |
Total Lines | 65 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
5 | class Container implements ContainerInterface |
||
6 | { |
||
7 | /** |
||
8 | * @var \Pimple\Container |
||
9 | */ |
||
10 | private $container; |
||
11 | |||
12 | /** |
||
13 | * @param array $values |
||
14 | * @throws ContainerException |
||
15 | */ |
||
16 | 3 | public function __construct(array $values = array()) |
|
17 | { |
||
18 | 3 | $this->container = new \Pimple\Container(); |
|
19 | 3 | foreach ($values as $id => $value){ |
|
20 | 3 | $this->set($id, $value); |
|
21 | } |
||
22 | 3 | } |
|
23 | |||
24 | /** |
||
25 | * @param string $id |
||
26 | * @return mixed |
||
27 | */ |
||
28 | 2 | public function get(string $id) |
|
31 | } |
||
32 | |||
33 | /** |
||
34 | * @param string $id |
||
35 | * @param mixed $value |
||
36 | * @return void |
||
37 | * @throws ContainerException |
||
38 | */ |
||
39 | 3 | public function set(string $id, $value) |
|
58 | 3 | } |
|
59 | |||
60 | /** |
||
61 | * @param string $id |
||
62 | * @param callable $callable |
||
63 | */ |
||
64 | 1 | public function extend(string $id, callable $callable) |
|
72 | } |