diff --git a/src/Entity/Activity.php b/src/Entity/Activity.php index 3d622ae..55b46b8 100644 --- a/src/Entity/Activity.php +++ b/src/Entity/Activity.php @@ -7,7 +7,7 @@ namespace JuniWalk\Calendar\Entity; -use DateTimeInterface; +use DateTime; use JuniWalk\Calendar\Enums\Day; use JuniWalk\Calendar\Event; use JuniWalk\Calendar\EventDetail; @@ -28,8 +28,8 @@ class Activity implements Event, EventDetail, EventLinkable, EventRecurring public mixed $groupId; public string $source; public bool $allDay; - public DateTimeInterface $start; - public ?DateTimeInterface $end; + public DateTime $start; + public ?DateTime $end; public string $title; public Html $titleHtml; /** @var string[] */ @@ -47,8 +47,8 @@ class Activity implements Event, EventDetail, EventLinkable, EventRecurring // EventRecurring /** @var DayNumber[] */ public array $daysOfWeek; - public ?DateTimeInterface $startRecur; - public ?DateTimeInterface $endRecur; + public ?DateTime $startRecur; + public ?DateTime $endRecur; public string $startTime; public string $endTime; @@ -87,21 +87,21 @@ public function getSource(): string } - public function setStart(DateTimeInterface $start): void + public function setStart(DateTime $start): void { $this->start = clone $start; } - public function getStart(): DateTimeInterface + public function getStart(): DateTime { return $this->start; } - public function setEnd(?DateTimeInterface $end): void + public function setEnd(?DateTime $end): void { - if ($end instanceof DateTimeInterface) { + if ($end instanceof DateTime) { $end = clone $end; } @@ -109,7 +109,7 @@ public function setEnd(?DateTimeInterface $end): void } - public function getEnd(): ?DateTimeInterface + public function getEnd(): ?DateTime { return $this->end ?? null; } @@ -163,7 +163,7 @@ public function setParams(array $params): void continue; } - if ($value instanceof DateTimeInterface) { + if ($value instanceof DateTime) { $value = clone $value; } diff --git a/src/Entity/Options.php b/src/Entity/Options.php index 8591be5..b9dea4b 100644 --- a/src/Entity/Options.php +++ b/src/Entity/Options.php @@ -8,7 +8,6 @@ namespace JuniWalk\Calendar\Entity; use DateTime; -use DateTimeInterface; use JuniWalk\Calendar\Calendar; use JuniWalk\Calendar\Config; use JuniWalk\Calendar\Event; @@ -392,7 +391,7 @@ public static function createSchema(): Schema } - protected function startsTooSoon(DateTimeInterface $date): bool + protected function startsTooSoon(DateTime $date): bool { $dow = (int) $date->format('N'); @@ -405,7 +404,7 @@ protected function startsTooSoon(DateTimeInterface $date): bool } - protected function endsTooLate(DateTimeInterface $date): bool + protected function endsTooLate(DateTime $date): bool { $dow = (int) $date->format('N'); diff --git a/src/Event.php b/src/Event.php index fbbca29..a91bff8 100644 --- a/src/Event.php +++ b/src/Event.php @@ -7,7 +7,7 @@ namespace JuniWalk\Calendar; -use DateTimeInterface as DateTime; +use DateTime; use JsonSerializable; interface Event extends JsonSerializable diff --git a/src/Source.php b/src/Source.php index a6277cf..e55cd70 100644 --- a/src/Source.php +++ b/src/Source.php @@ -7,7 +7,7 @@ namespace JuniWalk\Calendar; -use DateTimeInterface as DateTime; +use DateTime; use DateTimeZone; use JuniWalk\Calendar\Entity\Legend; use Nette\Application\UI\SignalReceiver; diff --git a/src/SourceEditable.php b/src/SourceEditable.php index 54b6ade..f351320 100644 --- a/src/SourceEditable.php +++ b/src/SourceEditable.php @@ -7,7 +7,7 @@ namespace JuniWalk\Calendar; -use DateTimeInterface as DateTime; +use DateTime; interface SourceEditable { diff --git a/src/Sources/CzechHolidaysSource.php b/src/Sources/CzechHolidaysSource.php index 0a750c7..a1777a0 100644 --- a/src/Sources/CzechHolidaysSource.php +++ b/src/Sources/CzechHolidaysSource.php @@ -8,7 +8,6 @@ namespace JuniWalk\Calendar\Sources; use DateTime; -use DateTimeInterface; use DateTimeZone; use JuniWalk\Calendar\Calendar; use JuniWalk\Calendar\Config; @@ -34,7 +33,7 @@ public function getLegend(): array /** * @return Event[] */ - public function fetchEvents(DateTimeInterface $start, DateTimeInterface $end, DateTimeZone $timeZone): array + public function fetchEvents(DateTime $start, DateTime $end, DateTimeZone $timeZone): array { $start = new DateTime($start->format(DateTime::ATOM)); $events = [];