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.

ContextLoggerPrefixFilterLogger   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 26
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A log() 0 10 2
1
<?php declare(strict_types=1);
2
3
namespace WyriHaximus\PSR3\Filter;
4
5
use Psr\Log\AbstractLogger;
6
use Psr\Log\LoggerInterface;
7
8
final class ContextLoggerPrefixFilterLogger extends AbstractLogger
9
{
10
    /**
11
     * @var LoggerInterface
12
     */
13
    private $logger;
14
15
    /**
16
     * @param LoggerInterface $logger
17
     */
18 15
    public function __construct(LoggerInterface $logger)
19
    {
20 15
        $this->logger = $logger;
21 15
    }
22
23 14
    public function log($level, $message, array $context = [])
24
    {
25 14
        $message = (string)$message;
26 14
        $pos = strrpos($message, ']');
27 14
        if ($pos !== false) {
28 1
            $message = substr($message, $pos + 1);
29 1
            $message = trim($message);
30
        }
31 14
        $this->logger->log($level, $message, $context);
32 13
    }
33
}
34