GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( f42e9e...cc52c7 )
by Cees-Jan
08:06
created

TraceProcessor::__invoke()   B

Complexity

Conditions 6
Paths 4

Size

Total Lines 19
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 19
rs 8.8571
c 0
b 0
f 0
cc 6
eloc 10
nc 4
nop 1
1
<?php declare(strict_types=1);
2
3
namespace WyriHaximus\Monolog\Processors;
4
5
use Throwable;
6
7
final class TraceProcessor
8
{
9
    /**
10
     * @param  array $record
11
     * @return array
12
     */
13
    public function __invoke(array $record)
14
    {
15
        if (isset($record['context']['exception']) && $record['context']['exception'] instanceof Throwable) {
16
            $record['extra']['trace'] = $record['context']['exception']->getTrace(DEBUG_BACKTRACE_IGNORE_ARGS);
17
            foreach ($record['extra']['trace'] as $index => $line) {
18
                if (!isset($line['args'])) {
19
                    continue;
20
                }
21
22
                unset($record['extra']['trace'][$index]['args']);
23
            }
24
        }
25
26
        if (!isset($record['extra']['trace'])) {
27
            $record['extra']['trace'] = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
28
        }
29
30
        return $record;
31
    }
32
}
33