| Conditions | 3 | 
| Paths | 3 | 
| Total Lines | 8 | 
| Code Lines | 6 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Tests | 0 | 
| CRAP Score | 12 | 
| Changes | 0 | ||
| 1 | <?php | ||
| 36 | public function log(Throwable $e, RouterMatch $request, AbstractAppMeta $appMeta): void | ||
| 37 |     { | ||
| 38 |         $logRefFile = sprintf('%s/logref.%s.log', $appMeta->logDir, $this->ref); | ||
| 39 | $log = (string) new ExceptionAsString($e, $request); | ||
| 40 | @file_put_contents($logRefFile, $log); | ||
|  | |||
| 41 |         $linkFile = sprintf('%s/last.logref.log', $appMeta->logDir); | ||
| 42 | is_link($linkFile) && is_writable($linkFile) && @unlink($linkFile); | ||
| 43 | @symlink($logRefFile, $linkFile); | ||
| 44 | } | ||
| 46 | 
If you suppress an error, we recommend checking for the error condition explicitly: