Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
29 / 29 |
|
100.00% |
27 / 27 |
CRAP | |
100.00% |
1 / 1 |
Event | |
100.00% |
29 / 29 |
|
100.00% |
27 / 27 |
27 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |||
getGuid | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getId | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getRoom | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getTitle | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
setTitle | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getSubtitle | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getType | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getDate | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getStart | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getDuration | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getDurationSeconds | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getAbstract | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getSlug | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getTrack | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getLogo | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getPersons | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getLanguage | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getDescription | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getRecording | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getLinks | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getAttachments | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getUrl | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getFeedbackUrl | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getOriginUrl | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getVideoDownloadUrl | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getEndDate | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | declare(strict_types=1); |
4 | |
5 | namespace Engelsystem\Helpers\Schedule; |
6 | |
7 | use Carbon\Carbon; |
8 | |
9 | class Event extends ScheduleData |
10 | { |
11 | use CalculatesTime; |
12 | |
13 | /** @var Carbon Calculated */ |
14 | protected Carbon $endDate; |
15 | |
16 | /** |
17 | * @param string $guid globally unique |
18 | * @param int $id globally unique |
19 | * @param string $start time (hh:mm:ss || hh:mm) |
20 | * @param string $duration (h?h:mm:ss || h?h:mm) |
21 | * @param string $slug globally unique |
22 | * @param array<int, string> $persons id => name |
23 | * @param string|null $language two-letter code |
24 | * @param EventRecording|null $recording license, links, url and opt out from XML, null if not defined |
25 | * @param array<string, string> $links href => title |
26 | * @param array<string, string> $attachments href => title |
27 | */ |
28 | public function __construct( |
29 | protected string $guid, |
30 | protected int $id, |
31 | protected Room $room, |
32 | protected string $title, |
33 | protected string $subtitle, |
34 | protected string $type, |
35 | protected Carbon $date, |
36 | protected string $start, |
37 | protected string $duration, |
38 | protected string $abstract, |
39 | protected string $slug, |
40 | protected ConferenceTrack $track, |
41 | protected ?string $logo = null, |
42 | protected array $persons = [], |
43 | protected ?string $language = null, |
44 | protected ?string $description = null, |
45 | protected ?EventRecording $recording = null, |
46 | protected array $links = [], |
47 | protected array $attachments = [], |
48 | protected ?string $url = null, |
49 | protected ?string $videoDownloadUrl = null, |
50 | protected ?string $feedbackUrl = null, |
51 | protected ?string $originUrl = null, |
52 | ) { |
53 | $this->endDate = $this->date |
54 | ->copy() |
55 | ->addSeconds($this->getDurationSeconds()); |
56 | } |
57 | |
58 | public function getGuid(): string |
59 | { |
60 | return $this->guid; |
61 | } |
62 | |
63 | public function getId(): int |
64 | { |
65 | return $this->id; |
66 | } |
67 | |
68 | public function getRoom(): Room |
69 | { |
70 | return $this->room; |
71 | } |
72 | |
73 | public function getTitle(): string |
74 | { |
75 | return $this->title; |
76 | } |
77 | |
78 | public function setTitle(string $title): void |
79 | { |
80 | $this->title = $title; |
81 | } |
82 | |
83 | public function getSubtitle(): string |
84 | { |
85 | return $this->subtitle; |
86 | } |
87 | |
88 | public function getType(): string |
89 | { |
90 | return $this->type; |
91 | } |
92 | |
93 | public function getDate(): Carbon |
94 | { |
95 | return $this->date; |
96 | } |
97 | |
98 | public function getStart(): string |
99 | { |
100 | return $this->start; |
101 | } |
102 | |
103 | public function getDuration(): string |
104 | { |
105 | return $this->duration; |
106 | } |
107 | |
108 | public function getDurationSeconds(): int |
109 | { |
110 | return $this->secondsFromTime($this->duration); |
111 | } |
112 | |
113 | public function getAbstract(): string |
114 | { |
115 | return $this->abstract; |
116 | } |
117 | |
118 | public function getSlug(): string |
119 | { |
120 | return $this->slug; |
121 | } |
122 | |
123 | public function getTrack(): ConferenceTrack |
124 | { |
125 | return $this->track; |
126 | } |
127 | |
128 | public function getLogo(): ?string |
129 | { |
130 | return $this->logo; |
131 | } |
132 | |
133 | /** |
134 | * @return array<string, string> |
135 | */ |
136 | public function getPersons(): array |
137 | { |
138 | return $this->persons; |
139 | } |
140 | |
141 | public function getLanguage(): ?string |
142 | { |
143 | return $this->language; |
144 | } |
145 | |
146 | public function getDescription(): ?string |
147 | { |
148 | return $this->description; |
149 | } |
150 | |
151 | public function getRecording(): ?EventRecording |
152 | { |
153 | return $this->recording; |
154 | } |
155 | |
156 | public function getLinks(): array |
157 | { |
158 | return $this->links; |
159 | } |
160 | |
161 | public function getAttachments(): array |
162 | { |
163 | return $this->attachments; |
164 | } |
165 | |
166 | public function getUrl(): ?string |
167 | { |
168 | return $this->url; |
169 | } |
170 | |
171 | public function getFeedbackUrl(): ?string |
172 | { |
173 | return $this->feedbackUrl; |
174 | } |
175 | |
176 | public function getOriginUrl(): ?string |
177 | { |
178 | return $this->originUrl; |
179 | } |
180 | |
181 | public function getVideoDownloadUrl(): ?string |
182 | { |
183 | return $this->videoDownloadUrl; |
184 | } |
185 | |
186 | public function getEndDate(): Carbon |
187 | { |
188 | return $this->endDate; |
189 | } |
190 | } |