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 ( 515224...041874 )
by Cees-Jan
04:19
created

Event::getChannel()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php declare(strict_types=1);
2
3
namespace ApiClients\Client\Pusher;
4
5
final class Event
6
{
7
    /**
8
     * @var string
9
     */
10
    private $event;
11
12
    /**
13
     * @var string
14
     */
15
    private $channel;
16
17
    /**
18
     * @var array
19
     */
20
    private $data;
21
22 3
    public static function createFromMessage(array $message): self
23
    {
24 3
        return new self(
25 3
            $message['event'],
26 3
            json_decode($message['data'], true),
27 3
            isset($message['channel']) ? $message['channel'] : ''
28
        );
29
    }
30
31
    /**
32
     * @param string $event
33
     * @param array $data
34
     * @param string $channel
35
     */
36 3
    public function __construct(string $event, array $data, string $channel = '')
37
    {
38 3
        $this->event = $event;
39 3
        $this->data = $data;
40 3
        $this->channel = $channel;
41 3
    }
42
43
    /**
44
     * @return string
45
     */
46 3
    public function getEvent()
47
    {
48 3
        return $this->event;
49
    }
50
51
    /**
52
     * @return string
53
     */
54 3
    public function getChannel()
55
    {
56 3
        return $this->channel;
57
    }
58
59
    /**
60
     * @return array
61
     */
62 3
    public function getData()
63
    {
64 3
        return $this->data;
65
    }
66
}
67