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

Complexity

Total Complexity 4

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 4
dl 0
loc 46
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getLogger() 0 4 1
A getSubscribedEvents() 0 6 1
A setQueue() 0 6 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