| Conditions | 2 |
| Paths | 2 |
| Total Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | protected function printResults(): void |
||
| 22 | { |
||
| 23 | $stream = fopen($this->file, 'w'); |
||
| 24 | |||
| 25 | $json = []; |
||
| 26 | |||
| 27 | foreach ($this->testsToPrint() as $test => $time) { |
||
| 28 | [$class, $method] = explode('::', $test); |
||
| 29 | |||
| 30 | $json[] = [ |
||
| 31 | 'time' => $time, |
||
| 32 | 'method' => $method, |
||
| 33 | 'class' => $class, |
||
| 34 | 'name' => $test |
||
| 35 | ]; |
||
| 36 | } |
||
| 37 | |||
| 38 | fwrite($stream, json_encode($json, JSON_PRETTY_PRINT)); |
||
| 39 | |||
| 40 | fclose($stream); |
||
| 41 | } |
||
| 42 | } |
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.