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 | * @throws \Noodlehaus\Exception\EmptyDirectoryException |
||
22 | */ |
||
23 | 5 | public function __construct($path) |
|
28 | |||
29 | /** |
||
30 | * @param string|array $file |
||
31 | * @return \PHPSemVerChecker\Configuration\Configuration |
||
32 | * @throws \Noodlehaus\Exception\EmptyDirectoryException |
||
33 | */ |
||
34 | public static function fromFile($file) |
||
38 | |||
39 | /** |
||
40 | * @param string $name |
||
41 | * @return \PHPSemVerChecker\Configuration\Configuration |
||
42 | * @throws \Noodlehaus\Exception\EmptyDirectoryException |
||
43 | */ |
||
44 | public static function defaults($name) |
||
48 | |||
49 | /** |
||
50 | * @param array $mapping |
||
51 | */ |
||
52 | 5 | protected function extractMapping(array $mapping) |
|
59 | |||
60 | /** |
||
61 | * @return array |
||
62 | */ |
||
63 | 1 | public function getLevelMapping() |
|
67 | |||
68 | /** |
||
69 | * @see \Noodlehaus\Config::get |
||
70 | * @param string $key |
||
71 | * @param mixed|null $default |
||
72 | * @return array|mixed|null |
||
73 | */ |
||
74 | 5 | public function get($key, $default = null) |
|
78 | |||
79 | /** |
||
80 | * @see \Noodlehaus\Config::set |
||
81 | * @param string $key |
||
82 | * @param mixed $value |
||
83 | */ |
||
84 | 2 | public function set($key, $value) |
|
88 | |||
89 | /** |
||
90 | * Merge this configuration with an associative array. |
||
91 | * |
||
92 | * Note that dot notation is used for keys. |
||
93 | * |
||
94 | * @param array $data |
||
95 | */ |
||
96 | public function merge($data) |
||
102 | } |
||
103 |