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.

RuntimeProcessor   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
eloc 4
c 1
b 0
f 1
dl 0
loc 14
ccs 6
cts 6
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A __invoke() 0 5 1
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
10
use function microtime;
11
12 3
final class RuntimeProcessor implements ProcessorInterface
13
{
14 3
    private float $start;
15 3
16
    public function __construct()
17
    {
18
        $this->start = microtime(true);
19
    }
20
21 3
    public function __invoke(LogRecord $record): LogRecord
22
    {
23 3
        $record->extra['runtime'] = microtime(true) - $this->start;
24
25 3
        return $record;
26
    }
27
}
28