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   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A log() 0 8 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 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