| Conditions | 5 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 3 |
| Ratio | 17.65 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 33 | public function generate(Metrics $metrics) |
||
| 34 | { |
||
| 35 | if ($this->config->has('quiet')) { |
||
| 36 | return; |
||
| 37 | } |
||
| 38 | |||
| 39 | |||
| 40 | $logFile = $this->config->get('report-json'); |
||
| 41 | if (!$logFile) { |
||
| 42 | return; |
||
| 43 | } |
||
| 44 | View Code Duplication | if (!file_exists(dirname($logFile)) || !is_writable(dirname($logFile))) { |
|
| 45 | throw new \RuntimeException('You don\'t have permissions to write JSON report in ' . $logFile); |
||
| 46 | } |
||
| 47 | |||
| 48 | file_put_contents($logFile, json_encode($metrics, JSON_PRETTY_PRINT)); |
||
| 49 | } |
||
| 50 | } |
||
| 51 |
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..