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   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 0
dl 0
loc 26
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B __invoke() 0 19 6
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