1 | <?php |
||
9 | class Config |
||
10 | { |
||
11 | /** |
||
12 | * Reference to the Symfony YAML parser. |
||
13 | * |
||
14 | * @var Symfony\Component\Yaml\Parser |
||
15 | */ |
||
16 | protected $parser; |
||
17 | |||
18 | /** |
||
19 | * Reference to a parrot file wrapper. |
||
20 | * |
||
21 | * @var Enzyme\Parrot\File |
||
22 | */ |
||
23 | protected $file_dispatch; |
||
24 | |||
25 | /** |
||
26 | * The local configuration store. |
||
27 | * |
||
28 | * @var array |
||
29 | */ |
||
30 | protected $store; |
||
31 | |||
32 | /** |
||
33 | * The parsed YAML configuration. |
||
34 | * |
||
35 | * @var array |
||
36 | */ |
||
37 | protected $config; |
||
38 | |||
39 | /** |
||
40 | * Create a new configuration manager. |
||
41 | * |
||
42 | * @param Parser $parser |
||
43 | * @param File $file_dispatch |
||
44 | */ |
||
45 | public function __construct(Parser $parser, File $file_dispatch) |
||
51 | |||
52 | /** |
||
53 | * Parse the given YAML file. |
||
54 | * |
||
55 | * @param string $file The path to the file. |
||
56 | */ |
||
57 | public function parse($file) |
||
73 | |||
74 | /** |
||
75 | * Get the value associated with the given key, if the key does not |
||
76 | * exist, return null. |
||
77 | * |
||
78 | * @param string $key |
||
79 | * |
||
80 | * @return null|string |
||
81 | */ |
||
82 | public function get($key) |
||
86 | |||
87 | /** |
||
88 | * This funky little method will get the value from a multidimensional |
||
89 | * array using a dot-path notation. Eg: 'foo.bar' will return the value 'ok' |
||
90 | * from the example array below. If the key cannot be found, it will return |
||
91 | * null instead. |
||
92 | * $arr = [ |
||
93 | * 'foo' => [ |
||
94 | * 'bar' => 'ok' |
||
95 | * ] |
||
96 | * ]; |
||
97 | * |
||
98 | * @param array $array |
||
99 | * @param string $path |
||
100 | * |
||
101 | * @return null|mixed |
||
102 | */ |
||
103 | protected function dotGet(array $array, $path) |
||
146 | } |
||
147 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..