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.

FailureSubscriber::getSubscribedEvents()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Bernard\EventListener;
4
5
use Bernard\Event\RejectEnvelopeEvent;
6
use Bernard\Producer;
7
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
8
9
class FailureSubscriber implements EventSubscriberInterface
10
{
11
    protected $producer;
12
    protected $name;
13
14
    /**
15
     * @param Producer $producer
16
     * @param string   $name
17
     */
18 1
    public function __construct(Producer $producer, $name = 'failed')
19
    {
20 1
        $this->producer = $producer;
21 1
        $this->name = $name;
22 1
    }
23
24
    /**
25
     * @param RejectEnvelopeEvent $event
26
     */
27 1
    public function onReject(RejectEnvelopeEvent $event)
28
    {
29 1
        $envelope = $event->getEnvelope();
30 1
        $message = $envelope->getMessage();
31
32 1
        $this->producer->produce($message, $this->name);
33 1
    }
34
35
    /**
36
     * @return array
37
     */
38
    public static function getSubscribedEvents()
39
    {
40
        return [
41
            'bernard.reject' => ['onReject'],
42
        ];
43
    }
44
}
45