1 | <?php declare(strict_types=1); |
||
11 | class YamlConfigFileLoader implements ConfigLoader |
||
12 | { |
||
13 | const KEY_HEADER = 'header'; |
||
14 | |||
15 | const KEY_DYNAMIC_VARIABLES = 'dynamic'; |
||
16 | |||
17 | const KEY_CONST_VARIABLES = 'const'; |
||
18 | |||
19 | const KEY_COMMAND_PATHS = 'paths'; |
||
20 | |||
21 | const KEY_ENVIRONMENTS = 'environments'; |
||
22 | |||
23 | const KEY_TEMPLATES = 'templates'; |
||
24 | |||
25 | /** |
||
26 | * @var Parser |
||
27 | */ |
||
28 | private $yamlReader; |
||
29 | |||
30 | /** |
||
31 | * @var ConfigBuilder |
||
32 | */ |
||
33 | private $configBuilder; |
||
34 | |||
35 | /** |
||
36 | * @param Parser $yamlReader |
||
37 | * @param ConfigBuilder $configBuilder |
||
38 | */ |
||
39 | public function __construct(Parser $yamlReader, ConfigBuilder $configBuilder) |
||
44 | |||
45 | /** |
||
46 | * @inheritdoc |
||
47 | */ |
||
48 | public function isSupported(string $file): bool |
||
52 | |||
53 | /** |
||
54 | * @inheritdoc |
||
55 | */ |
||
56 | public function load(string $file, array $params): Config |
||
80 | |||
81 | /** |
||
82 | * @param string $file |
||
83 | * @param array $rawConfigData |
||
84 | */ |
||
85 | private function setConfigData(string $file, array $rawConfigData) |
||
108 | |||
109 | /** |
||
110 | * @param string $key |
||
111 | * @param array $rawConfig |
||
112 | * @param bool $default |
||
113 | * @return mixed|null |
||
114 | */ |
||
115 | private function extractData(string $key, array $rawConfig, $default = false) |
||
123 | |||
124 | /** |
||
125 | * @param string $file |
||
126 | * @return string |
||
127 | */ |
||
128 | private function loadFileContents(string $file): string |
||
132 | |||
133 | /** |
||
134 | * @param string $contents |
||
135 | * @return array |
||
136 | */ |
||
137 | private function parseFileContents(string $contents): array |
||
141 | |||
142 | /** |
||
143 | * @param string $file |
||
144 | * @param $rawConfigData |
||
145 | * @return array |
||
146 | */ |
||
147 | private function extractCommandPaths(string $file, array $rawConfigData): array |
||
155 | |||
156 | /** |
||
157 | * @param string $absoluteOrRelativePath |
||
158 | * @param string $baseFile |
||
159 | * @return string |
||
160 | */ |
||
161 | private function fixPath(string $absoluteOrRelativePath, string $baseFile): string |
||
169 | } |
||
170 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: