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.

Plugin::getSubscribedEvents()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 2
cts 2
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
crap 1
1
<?php declare(strict_types=1);
2
3
namespace WyriHaximus\React\PSR3\Phergie;
4
5
use Phergie\Irc\Bot\React\AbstractPlugin;
6
use Phergie\Irc\Bot\React\EventQueueInterface as Queue;
7
use Phergie\Irc\Event\Event;
8
use Psr\Log\LoggerInterface;
9
10
final class Plugin extends AbstractPlugin
11
{
12
    /**
13
     * @var string
14
     */
15
    private $channel;
16
17
    /**
18
     * @var LogStream
19
     */
20
    private $stream;
21
22
    /**
23
     * @var PluginLogger
24
     */
25
    private $pluginLogger;
26
27 3
    public function __construct(string $channel)
28
    {
29 3
        $this->channel = $channel;
30 3
        $this->stream = new LogStream();
31 3
        $this->pluginLogger = new PluginLogger($this->stream);
32 3
    }
33
34
    /**
35
     * @return LoggerInterface
36
     */
37 2
    public function getLogger(): LoggerInterface
38
    {
39 2
        return $this->pluginLogger;
40
    }
41
42 1
    public function getSubscribedEvents(): array
43
    {
44
        return [
45 1
            'irc.sent.user' => 'setQueue',
46
        ];
47
    }
48
49
    public function setQueue(Event $event, Queue $queue)
50
    {
51 1
        $this->stream->subscribe(function (Entry $entry) use ($queue) {
52 1
            $queue->ircPrivmsg($this->channel, $entry->getPsrMessage());
53 1
        });
54
    }
55
}
56