Total Complexity | 5 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | class AbstractContainer implements ContainerInterface |
||
16 | { |
||
17 | /** |
||
18 | * @var array |
||
19 | */ |
||
20 | protected $data; |
||
21 | |||
22 | /** |
||
23 | * AbstractRequestMethod constructor. |
||
24 | * @param array $data |
||
25 | */ |
||
26 | public function __construct(array $data = []) |
||
27 | { |
||
28 | $this->data = $data; |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * @param string|null $key |
||
33 | * @return array |
||
34 | */ |
||
35 | public function get(string $key = null) |
||
36 | { |
||
37 | return empty($key) ? $this->data : $this->data[$key]; |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * @param array $data |
||
42 | */ |
||
43 | public function set(array $data): void |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * @param string $key |
||
50 | * @return bool |
||
51 | */ |
||
52 | public function has(string $key): bool |
||
55 | } |
||
56 | } |
||
57 |