Total Complexity | 7 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | class Config |
||
8 | { |
||
9 | /** |
||
10 | * @var array |
||
11 | */ |
||
12 | private $data; |
||
13 | |||
14 | /** |
||
15 | * Config constructor. |
||
16 | * @param array $data |
||
17 | */ |
||
18 | public function __construct(array $data = []) |
||
19 | { |
||
20 | $this->data = $data; |
||
21 | } |
||
22 | |||
23 | /** |
||
24 | * Get value by using dot notation for nested arrays. |
||
25 | * |
||
26 | * @example $value = $this->get('foo.bar.baz'); |
||
27 | * |
||
28 | * @param string $name |
||
29 | * @param mixed $default |
||
30 | * @return mixed |
||
31 | */ |
||
32 | public function get(string $name, $default = null) |
||
46 | } |
||
47 | } |
||
48 |