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.

LogLevelFilterLogger::log()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 3
dl 0
loc 8
ccs 5
cts 5
cp 1
crap 2
rs 10
c 0
b 0
f 0
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 LogLevelFilterLogger extends AbstractLogger
9
{
10
    /**
11
     * @var array
12
     */
13
    private $levels;
14
15
    /**
16
     * @var LoggerInterface
17
     */
18
    private $logger;
19
20
    /**
21
     * @param array           $levels
22
     * @param LoggerInterface $logger
23
     */
24 15
    public function __construct(array $levels, LoggerInterface $logger)
25
    {
26 15
        $this->levels = $levels;
27 15
        $this->logger = $logger;
28 15
    }
29
30 14
    public function log($level, $message, array $context = [])
31
    {
32 14
        if (in_array($level, $this->levels, true)) {
33 1
            return;
34
        }
35
36 14
        $this->logger->log($level, $message, $context);
37 13
    }
38
}
39