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