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