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.

ChannelLogger::log()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 10
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 12
ccs 10
cts 10
cp 1
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 3
crap 1
1
<?php declare(strict_types=1);
2
3
namespace WyriHaximus\React\PSR3\Bunny;
4
5
use Bunny\Channel;
6
use Psr\Log\AbstractLogger;
7
use function WyriHaximus\PSR3\checkCorrectLogLevel;
8
use function WyriHaximus\PSR3\normalizeContext;
9
use function WyriHaximus\PSR3\processPlaceHolders;
10
11
final class ChannelLogger extends AbstractLogger
12
{
13
    /**
14
     * @var Channel
15
     */
16
    private $channel;
17
18
    /**
19
     * @var array
20
     */
21
    private $publishArguments;
22
23
    /**
24
     * @param Channel $channel
25
     * @param array   $publishArguments
26
     */
27 14
    public function __construct(Channel $channel, ...$publishArguments)
28
    {
29 14
        $this->channel = $channel;
30 14
        $this->publishArguments = $publishArguments;
31 14
    }
32
33 13
    public function log($level, $message, array $context = [])
34
    {
35 13
        checkCorrectLogLevel($level);
36 12
        $context = normalizeContext($context);
37 12
        $message = (string)$message;
38 12
        $message = processPlaceHolders($message, $context);
39 12
        $json = json_encode([
40 12
            'level' => $level,
41 12
            'message' => $message,
42 12
            'context' => $context,
43
        ]);
44 12
        $this->channel->publish($json, ...$this->publishArguments);
0 ignored issues
show
Bug introduced by
$this->publishArguments is expanded, but the parameter $headers of Bunny\Channel::publish() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

44
        $this->channel->publish($json, /** @scrutinizer ignore-type */ ...$this->publishArguments);
Loading history...
45 12
    }
46
}
47