Total Complexity | 9 |
Total Lines | 53 |
Duplicated Lines | 0 % |
Coverage | 88.89% |
Changes | 0 |
1 | <?php |
||
5 | class Container |
||
6 | { |
||
7 | |||
8 | private $registry = []; |
||
9 | |||
10 | |||
11 | 35 | public function bind($key, $data) |
|
12 | { |
||
13 | 35 | if ($this->bound($key)) { |
|
14 | 4 | return $this->rebind($key, $data); |
|
15 | } |
||
16 | |||
17 | 35 | return $this->registry[$key] = $data; |
|
18 | } |
||
19 | |||
20 | |||
21 | 14 | public function append($key, $data) |
|
22 | { |
||
23 | 14 | return $this->registry[$key][] = $data; |
|
24 | } |
||
25 | |||
26 | |||
27 | 28 | public function get($key) |
|
28 | { |
||
29 | 28 | if (!$this->bound($key)) { |
|
30 | 11 | return null; |
|
31 | } |
||
32 | |||
33 | 28 | return $this->registry[$key]; |
|
34 | } |
||
35 | |||
36 | |||
37 | 28 | public function all() |
|
40 | } |
||
41 | |||
42 | |||
43 | public function has($key) |
||
46 | } |
||
47 | |||
48 | |||
49 | 35 | private function bound($key) |
|
52 | } |
||
53 | |||
54 | |||
55 | 4 | private function rebind($key, $data) |
|
60 |