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 ( 766e5a...64b934 )
by Cees-Jan
09:28 queued 08:12
created

ContextLogger   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

2 Methods

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