| Total Complexity | 7 |
| Total Lines | 83 |
| Duplicated Lines | 0 % |
| Coverage | 29.4% |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class CalendarEvent extends EventDispatcher |
||
| 9 | { |
||
| 10 | const SET_DATA = 'fullcalendar.set_data'; |
||
| 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 | * @param \DateTimeInterface $start |
||
| 34 | * @param \DateTimeInterface $end |
||
| 35 | * @param array $filters |
||
| 36 | */ |
||
| 37 | 1 | public function __construct( |
|
| 38 | \DateTimeInterface $start, |
||
| 39 | \DateTimeInterface $end, |
||
| 40 | array $filters |
||
| 41 | ) { |
||
| 42 | 1 | $this->start = $start; |
|
| 43 | 1 | $this->end = $end; |
|
| 44 | 1 | $this->filters = $filters; |
|
| 45 | 1 | } |
|
| 46 | |||
| 47 | /** |
||
| 48 | * @return \DateTimeInterface |
||
| 49 | */ |
||
| 50 | public function getStart(): \DateTimeInterface |
||
| 51 | { |
||
| 52 | return $this->start; |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @return \DateTimeInterface |
||
| 57 | */ |
||
| 58 | public function getEnd(): \DateTimeInterface |
||
| 59 | { |
||
| 60 | return $this->end; |
||
| 61 | } |
||
| 62 | |||
| 63 | /** |
||
| 64 | * @return array |
||
| 65 | */ |
||
| 66 | public function getFilters(): array |
||
| 67 | { |
||
| 68 | return $this->filters; |
||
| 69 | } |
||
| 70 | |||
| 71 | /** |
||
| 72 | * @param Event $event |
||
| 73 | * |
||
| 74 | * @return $this |
||
| 75 | */ |
||
| 76 | public function addEvent(Event $event): self |
||
| 77 | { |
||
| 78 | if (!in_array($event, $this->events, true)) { |
||
| 79 | $this->events[] = $event; |
||
| 80 | } |
||
| 81 | |||
| 82 | return $this; |
||
| 83 | } |
||
| 84 | |||
| 85 | /** |
||
| 86 | * @return Event[] |
||
| 87 | */ |
||
| 88 | public function getEvents(): array |
||
| 91 | } |
||
| 92 | } |
||
| 93 |