Total Complexity | 5 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
6 | class ShopConfig |
||
7 | { |
||
8 | /** |
||
9 | * @var string |
||
10 | */ |
||
11 | private $configFilePath; |
||
12 | |||
13 | /** |
||
14 | * @var array |
||
15 | */ |
||
16 | private $config; |
||
17 | |||
18 | /** |
||
19 | * ShopConfig constructor. |
||
20 | * @param string $configFilePath |
||
21 | */ |
||
22 | 2 | public function __construct(string $configFilePath) |
|
25 | 2 | } |
|
26 | |||
27 | /** |
||
28 | * @param string $id |
||
29 | * @return mixed|null |
||
30 | */ |
||
31 | 2 | public function get(string $id) |
|
32 | { |
||
33 | 2 | return $this->getConfig()[$id] ?? null; |
|
34 | } |
||
35 | |||
36 | /** |
||
37 | * @return array |
||
38 | */ |
||
39 | 2 | private function getConfig(): array |
|
50 | } |
||
51 | } |