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 ( 547017...c67bb4 )
by Christian
04:20
created

EventInfo::__construct()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 25
Code Lines 23

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 25
rs 8.8571
cc 1
eloc 23
nc 1
nop 11

How to fix   Many Parameters   

Many Parameters

Methods with many parameters are not only hard to understand, but their parameters also often become inconsistent when you need more, or different data.

There are several approaches to avoid long parameter lists:

1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * (c) Christian Gripp <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Core23\LastFm\Model;
13
14
final class EventInfo
15
{
16
    /**
17
     * @var int
18
     */
19
    private $eventId;
20
21
    /**
22
     * @var string
23
     */
24
    private $title;
25
26
    /**
27
     * @var string|null
28
     */
29
    private $description;
30
31
    /**
32
     * @var \DateTime
33
     */
34
    private $eventDate;
35
36
    /**
37
     * @var \DateTime|null
38
     */
39
    private $eventEndDate;
40
41
    /**
42
     * @var string|null
43
     */
44
    private $eventWebsite;
45
46
    /**
47
     * @var Image|null
48
     */
49
    private $image;
50
51
    /**
52
     * @var string
53
     */
54
    private $url;
55
56
    /**
57
     * @var bool
58
     */
59
    private $festival;
60
61
    /**
62
     * @var Venue
63
     */
64
    private $venue;
65
66
    /**
67
     * @var Artist[]
68
     */
69
    private $artists;
70
71
    /**
72
     * EventInfo constructor.
73
     *
74
     * @param int            $eventId
75
     * @param string         $title
76
     * @param null|string    $description
77
     * @param \DateTime      $eventDate
78
     * @param \DateTime|null $eventEndDate
79
     * @param null|string    $eventWebsite
80
     * @param Image|null     $image
81
     * @param string         $url
82
     * @param bool           $festival
83
     * @param Venue          $venue
84
     * @param Artist[]       $artists
85
     */
86
    public function __construct(
87
        int $eventId,
88
        string $title,
89
        ?string $description,
90
        \DateTime $eventDate,
91
        ?\DateTime $eventEndDate,
92
        ?string $eventWebsite,
93
        ?Image $image,
94
        string $url,
95
        bool $festival,
96
        Venue $venue,
97
        array $artists
98
    ) {
99
        $this->eventId      = $eventId;
100
        $this->title        = $title;
101
        $this->description  = $description;
102
        $this->eventDate    = $eventDate;
103
        $this->eventEndDate = $eventEndDate;
104
        $this->eventWebsite = $eventWebsite;
105
        $this->image        = $image;
106
        $this->url          = $url;
107
        $this->festival     = $festival;
108
        $this->venue        = $venue;
109
        $this->artists      = $artists;
110
    }
111
112
    /**
113
     * @return int
114
     */
115
    public function getEventId(): int
116
    {
117
        return $this->eventId;
118
    }
119
120
    /**
121
     * @return string
122
     */
123
    public function getTitle(): string
124
    {
125
        return $this->title;
126
    }
127
128
    /**
129
     * @return null|string
130
     */
131
    public function getDescription(): ?string
132
    {
133
        return $this->description;
134
    }
135
136
    /**
137
     * @return \DateTime
138
     */
139
    public function getEventDate(): \DateTime
140
    {
141
        return $this->eventDate;
142
    }
143
144
    /**
145
     * @return \DateTime|null
146
     */
147
    public function getEventEndDate(): ?\DateTime
148
    {
149
        return $this->eventEndDate;
150
    }
151
152
    /**
153
     * @return null|string
154
     */
155
    public function getEventWebsite(): ?string
156
    {
157
        return $this->eventWebsite;
158
    }
159
160
    /**
161
     * @return Image|null
162
     */
163
    public function getImage(): ?Image
164
    {
165
        return $this->image;
166
    }
167
168
    /**
169
     * @return string
170
     */
171
    public function getUrl(): string
172
    {
173
        return $this->url;
174
    }
175
176
    /**
177
     * @return bool
178
     */
179
    public function isFestival(): bool
180
    {
181
        return $this->festival;
182
    }
183
184
    /**
185
     * @return Venue
186
     */
187
    public function getVenue(): Venue
188
    {
189
        return $this->venue;
190
    }
191
192
    /**
193
     * @return Artist[]
194
     */
195
    public function getArtists(): array
196
    {
197
        return $this->artists;
198
    }
199
}
200