| Conditions | 7 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 7.0671 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | public function __invoke(LogRecord $record): LogRecord |
||
| 24 | { |
||
| 25 | if (array_key_exists('exception', $record->context) && $record->context['exception'] instanceof Throwable) { |
||
| 26 | 5 | $record->extra['trace'] = $record->context['exception']->getTrace(); |
|
| 27 | foreach ($record->extra['trace'] as $index => $line) { |
||
| 28 | 5 | if (! array_key_exists('args', $line)) { |
|
| 29 | 2 | continue; |
|
| 30 | 2 | } |
|
| 31 | 2 | ||
| 32 | unset($record->extra['trace'][$index]['args']); |
||
| 33 | } |
||
| 34 | } |
||
| 35 | 2 | ||
| 36 | if ($this->always && ! array_key_exists('trace', $record->extra)) { |
||
| 37 | $record->extra['trace'] = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); |
||
| 38 | } |
||
| 39 | 5 | ||
| 40 | 1 | return $record; |
|
| 41 | } |
||
| 43 |