Conditions | 6 |
Paths | 4 |
Total Lines | 24 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | protected function loadFile() |
||
28 | { |
||
29 | $dataValue = Base::readJsonOrYaml($this->schema, $this->response); |
||
30 | if (!$dataValue) { |
||
31 | throw new ExitCode('Unable to find schema in ' . $this->schema, 1); |
||
32 | } |
||
33 | |||
34 | if (!empty($this->patches)) { |
||
35 | foreach ($this->patches as $patchPath) { |
||
36 | $patch = Base::readJsonOrYaml($patchPath, $this->response); |
||
37 | if (is_array($patch)) { |
||
38 | $jp = JsonPatch::import($patch); |
||
39 | try { |
||
40 | $jp->apply($dataValue); |
||
41 | } catch (Exception $e) { |
||
42 | throw new ExitCode($e->getMessage(), 1); |
||
43 | } |
||
44 | } else { |
||
45 | JsonMergePatch::apply($dataValue, $patch); |
||
46 | } |
||
47 | } |
||
48 | } |
||
49 | |||
50 | return $dataValue; |
||
51 | } |
||
52 | } |
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..