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.

EventConfig::__construct()   B
last analyzed

Complexity

Conditions 5
Paths 16

Size

Total Lines 13
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 5
eloc 8
nc 16
nop 1
dl 0
loc 13
rs 8.8571
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Teebot\Configuration\ValueObject;
6
7
/**
8
 * EventConfig value object
9
 */
10
class EventConfig
11
{
12
    /**
13
     * @var string
14
     */
15
    protected $command;
16
17
    /**
18
     * @var string
19
     */
20
    protected $type;
21
22
    /**
23
     * @var string
24
     */
25
    protected $class;
26
27
    /**
28
     * @var array
29
     */
30
    protected $params = [];
31
32
    /**
33
     * @param array $data
34
     */
35
    public function __construct(array $data)
36
    {
37
        if (isset($data['command'])) {
38
            $this->command = $data['command'];
39
        }
40
        if (isset($data['type'])) {
41
            $this->type = $data['type'];
42
        }
43
        if (isset($data['class'])) {
44
            $this->class = $data['class'];
45
        }
46
        if (isset($data['params'])) {
47
            $this->params = $data['params'];
48
        }
49
    }
50
51
    /**
52
     * @return string|null
53
     */
54
    public function getCommand(): ?string
55
    {
56
        return $this->command;
57
    }
58
59
    /**
60
     * @return  string|null
61
     */
62
    public function getType(): ?string
63
    {
64
        return $this->type;
65
    }
66
67
    /**
68
     * @return  string|null
69
     */
70
    public function getClass(): ?string
71
    {
72
        return $this->class;
73
    }
74
75
    /**
76
     * @return array
77
     */
78
    public function getParams(): array
79
    {
80
        return $this->params;
81
    }
82
}
83