Total Complexity | 8 |
Total Lines | 77 |
Duplicated Lines | 0 % |
Coverage | 90% |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | class CalendarEvent extends BaseEvent |
||
|
|||
11 | { |
||
12 | /** |
||
13 | * @var \DateTimeInterface |
||
14 | */ |
||
15 | protected $start; |
||
16 | |||
17 | /** |
||
18 | * @var \DateTimeInterface |
||
19 | */ |
||
20 | protected $end; |
||
21 | |||
22 | /** |
||
23 | * @var array |
||
24 | */ |
||
25 | protected $filters; |
||
26 | |||
27 | /** |
||
28 | * @var Event[] |
||
29 | */ |
||
30 | protected $events = []; |
||
31 | |||
32 | /** |
||
33 | * @var string|null |
||
34 | */ |
||
35 | private $timezone; |
||
36 | |||
37 | 4 | public function __construct( |
|
47 | 4 | } |
|
48 | |||
49 | 1 | public function getStart(): \DateTimeInterface |
|
50 | { |
||
51 | 1 | return $this->start; |
|
52 | } |
||
53 | |||
54 | 1 | public function getEnd(): \DateTimeInterface |
|
55 | { |
||
56 | 1 | return $this->end; |
|
57 | } |
||
58 | |||
59 | 1 | public function getFilters(): array |
|
60 | { |
||
61 | 1 | return $this->filters; |
|
62 | } |
||
63 | |||
64 | public function getTimezone(): ?string |
||
65 | { |
||
66 | return $this->timezone; |
||
67 | } |
||
68 | |||
69 | /** |
||
70 | * @return $this |
||
71 | */ |
||
72 | 1 | public function addEvent(Event $event): self |
|
73 | { |
||
74 | 1 | if (!\in_array($event, $this->events, true)) { |
|
75 | 1 | $this->events[] = $event; |
|
76 | } |
||
77 | |||
78 | 1 | return $this; |
|
79 | } |
||
80 | |||
81 | /** |
||
82 | * @return Event[] |
||
83 | */ |
||
84 | 1 | public function getEvents(): array |
|
87 | } |
||
88 | } |
||
89 |