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.

ExceptionClassProcessor::__invoke()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 7
ccs 1
cts 1
cp 1
rs 10
cc 3
nc 2
nop 1
crap 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace WyriHaximus\Monolog\Processors;
6
7
use Monolog\LogRecord;
8
use Monolog\Processor\ProcessorInterface;
9
use Throwable;
10
11 4
use function array_key_exists;
12
use function get_class;
13 4
14 2
final class ExceptionClassProcessor implements ProcessorInterface
15
{
16
    public function __invoke(LogRecord $record): LogRecord
17 4
    {
18
        if (array_key_exists('exception', $record->context) && $record->context['exception'] instanceof Throwable) {
19
            $record->extra['exception_class'] = get_class($record->context['exception']);
20
        }
21
22
        return $record;
23
    }
24
}
25