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 ( 010784...210d89 )
by Carsten
08:21 queued 12s
created

HtmlFormattedTeamsLogHandler   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 2
dl 0
loc 36
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getMessage() 0 11 1
1
<?php
2
namespace Germania\Logger;
3
4
use CMDISP\MonologMicrosoftTeams\TeamsLogHandler;
5
use CMDISP\MonologMicrosoftTeams\TeamsMessage;
6
7
use Monolog\Logger;
8
9
/**
10
 * TeamsLogHandler extension 
11
 * Additionally renders the _formatted_ Logger message
12
 */
13
14
class HtmlFormattedTeamsLogHandler extends TeamsLogHandler
15
{
16
17
    /**
18
     * (Make this private member accessible in this class)
19
     * @var array
20
     */
21
    private static $levelColors = [
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
22
        Logger::DEBUG => '0080FF',
23
        Logger::INFO => '0080FF',
24
        Logger::NOTICE => '0080FF',
25
        Logger::WARNING => 'FF8000',
26
        Logger::ERROR => 'FF0000',
27
        Logger::CRITICAL => 'FF0000',
28
        Logger::ALERT => 'FF0000',
29
        Logger::EMERGENCY => 'FF0000',
30
    ];
31
32
33
    /**
34
     * Uses the _formatted_ entry rather than the 
35
     * @inheritDoc
36
     */
37
    protected function getMessage(array $record)
38
    {
39
        return new TeamsMessage([
40
            'text' => $record['formatted'],
41
42
            // This was the original:
43
            // 'text' => $record['level_name'] . ': ' . $record['message'],
44
45
            'themeColor' => self::$levelColors[$record['level']] ?? self::$levelColors[$this->level],
46
        ]);
47
    }
48
49
}