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.
Passed
Push — master ( cf47da...53c71b )
by James
21:48 queued 09:49
created

AuditProcessor::__invoke()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 11
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
1
<?php
2
3
/**
4
 * AuditProcessor.php
5
 * Copyright (c) 2019 [email protected]
6
 *
7
 * This file is part of Firefly III.
8
 *
9
 * Firefly III is free software: you can redistribute it and/or modify
10
 * it under the terms of the GNU General Public License as published by
11
 * the Free Software Foundation, either version 3 of the License, or
12
 * (at your option) any later version.
13
 *
14
 * Firefly III is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU General Public License
20
 * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
21
 */
22
23
declare(strict_types=1);
24
25
namespace FireflyIII\Support\Logging;
26
27
/**
28
 * Class AuditProcessor
29
 */
30
class AuditProcessor
31
{
32
    /**
33
     * @param array $record
34
     *
35
     * @return array
36
     */
37
    public function __invoke(array $record): array
38
    {
39
        $record['extra']['path'] = request()->method() . ':' . request()->url();
40
41
        $record['extra']['IP'] = app('request')->ip();
42
        if (auth()->check()) {
43
            $record['extra']['user'] = auth()->user()->email;
44
        }
45
46
47
        return $record;
48
    }
49
}
50