Conditions | 2 |
Paths | 2 |
Total Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
15 | protected function printResults(): void |
||
16 | { |
||
17 | $stream = fopen($this->file, 'w'); |
||
18 | |||
19 | $json = []; |
||
20 | |||
21 | foreach ($this->testsToPrint() as $test => $time) { |
||
22 | [$class, $method] = explode('::', $test); |
||
23 | |||
24 | $json[] = [ |
||
25 | 'time' => $time, |
||
26 | 'method' => $method, |
||
27 | 'class' => $class, |
||
28 | 'name' => $test |
||
29 | ]; |
||
30 | } |
||
31 | |||
32 | fwrite($stream, json_encode($json, JSON_PRETTY_PRINT)); |
||
33 | |||
34 | fclose($stream); |
||
35 | } |
||
36 | } |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.