Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
28 / 28
100.00% covered (success)
100.00%
26 / 26
CRAP
100.00% covered (success)
100.00%
1 / 1
Event
100.00% covered (success)
100.00%
28 / 28
100.00% covered (success)
100.00%
26 / 26
26
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
 getGuid
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getId
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getRoom
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getTitle
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setTitle
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getSubtitle
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getType
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getDate
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getStart
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getDuration
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getDurationSeconds
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getAbstract
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getSlug
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getTrack
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getLogo
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getPersons
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getLanguage
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getDescription
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getRecording
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getLinks
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getAttachments
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getUrl
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getFeedbackUrl
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getVideoDownloadUrl
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getEndDate
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace Engelsystem\Helpers\Schedule;
6
7use Carbon\Carbon;
8
9class 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    ) {
52        $this->endDate = $this->date
53            ->copy()
54            ->addSeconds($this->getDurationSeconds());
55    }
56
57    public function getGuid(): string
58    {
59        return $this->guid;
60    }
61
62    public function getId(): int
63    {
64        return $this->id;
65    }
66
67    public function getRoom(): Room
68    {
69        return $this->room;
70    }
71
72    public function getTitle(): string
73    {
74        return $this->title;
75    }
76
77    public function setTitle(string $title): void
78    {
79        $this->title = $title;
80    }
81
82    public function getSubtitle(): string
83    {
84        return $this->subtitle;
85    }
86
87    public function getType(): string
88    {
89        return $this->type;
90    }
91
92    public function getDate(): Carbon
93    {
94        return $this->date;
95    }
96
97    public function getStart(): string
98    {
99        return $this->start;
100    }
101
102    public function getDuration(): string
103    {
104        return $this->duration;
105    }
106
107    public function getDurationSeconds(): int
108    {
109        return $this->secondsFromTime($this->duration);
110    }
111
112    public function getAbstract(): string
113    {
114        return $this->abstract;
115    }
116
117    public function getSlug(): string
118    {
119        return $this->slug;
120    }
121
122    public function getTrack(): ConferenceTrack
123    {
124        return $this->track;
125    }
126
127    public function getLogo(): ?string
128    {
129        return $this->logo;
130    }
131
132    /**
133     * @return array<string, string>
134     */
135    public function getPersons(): array
136    {
137        return $this->persons;
138    }
139
140    public function getLanguage(): ?string
141    {
142        return $this->language;
143    }
144
145    public function getDescription(): ?string
146    {
147        return $this->description;
148    }
149
150    public function getRecording(): ?EventRecording
151    {
152        return $this->recording;
153    }
154
155    public function getLinks(): array
156    {
157        return $this->links;
158    }
159
160    public function getAttachments(): array
161    {
162        return $this->attachments;
163    }
164
165    public function getUrl(): ?string
166    {
167        return $this->url;
168    }
169
170    public function getFeedbackUrl(): ?string
171    {
172        return $this->feedbackUrl;
173    }
174
175    public function getVideoDownloadUrl(): ?string
176    {
177        return $this->videoDownloadUrl;
178    }
179
180    public function getEndDate(): Carbon
181    {
182        return $this->endDate;
183    }
184}