1 | <?php |
||
8 | class Configuration |
||
9 | { |
||
10 | /** |
||
11 | * @var array |
||
12 | */ |
||
13 | protected $mapping = []; |
||
14 | /** |
||
15 | * @var \Noodlehaus\Config |
||
16 | */ |
||
17 | protected $config; |
||
18 | |||
19 | /** |
||
20 | * @param string|array $path |
||
21 | */ |
||
22 | 5 | public function __construct($path) |
|
27 | |||
28 | /** |
||
29 | * @param string|array $file |
||
30 | * @return \PHPSemVerChecker\Configuration\Configuration |
||
31 | */ |
||
32 | public static function fromFile($file) |
||
36 | |||
37 | /** |
||
38 | * @return \PHPSemVerChecker\Configuration\Configuration |
||
39 | */ |
||
40 | public static function defaults() |
||
44 | |||
45 | /** |
||
46 | * @param array $mapping |
||
47 | */ |
||
48 | 5 | protected function extractMapping(array $mapping) |
|
55 | |||
56 | /** |
||
57 | * @return array |
||
58 | */ |
||
59 | 1 | public function getLevelMapping() |
|
63 | |||
64 | /** |
||
65 | * @see \Noodlehaus\Config::get |
||
66 | * @param string $key |
||
67 | * @param mixed|null $default |
||
68 | * @return array|mixed|null |
||
69 | */ |
||
70 | 5 | public function get($key, $default = null) |
|
74 | |||
75 | /** |
||
76 | * @see \Noodlehaus\Config::set |
||
77 | * @param string $key |
||
78 | * @param mixed $value |
||
79 | */ |
||
80 | 2 | public function set($key, $value) |
|
84 | |||
85 | /** |
||
86 | * Merge this configuration with an associative array. |
||
87 | * |
||
88 | * Note that dot notation is used for keys. |
||
89 | * |
||
90 | * @param array $data |
||
91 | */ |
||
92 | 1 | public function merge($data) |
|
98 | } |
||
99 |