From 7312b2d407194e2c7a4a2ef243258b70ffb1ea9e Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Wed, 5 Jun 2024 11:24:22 +0200 Subject: [PATCH] Fix typehint --- lib/GaletteEvents/Activity.php | 4 ++-- lib/GaletteEvents/Booking.php | 8 ++++---- lib/GaletteEvents/Event.php | 4 ++-- lib/GaletteEvents/Repository/Bookings.php | 2 +- lib/GaletteEvents/Repository/Events.php | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/GaletteEvents/Activity.php b/lib/GaletteEvents/Activity.php index a4d656a..bd5e636 100644 --- a/lib/GaletteEvents/Activity.php +++ b/lib/GaletteEvents/Activity.php @@ -113,7 +113,7 @@ public function load(int $id): bool */ private function loadFromRS(ArrayObject $r): void { - $this->id = $r->id_activity; + $this->id = (int)$r->id_activity; $this->name = $r->name; $this->active = (bool)$r->is_active; $this->creation_date = $r->creation_date; @@ -384,7 +384,7 @@ public function countEvents(): int $results = $this->zdb->execute($select); $result = $results->current(); $count = $result->counter; - return $count; + return (int)$count; } /** diff --git a/lib/GaletteEvents/Booking.php b/lib/GaletteEvents/Booking.php index 139a32e..1ee45eb 100644 --- a/lib/GaletteEvents/Booking.php +++ b/lib/GaletteEvents/Booking.php @@ -124,13 +124,13 @@ public function load(int $id): bool */ private function loadFromRS(ArrayObject $r): void { - $this->id = $r->id_booking; + $this->id = (int)$r->id_booking; $this->event = $r->id_event; - $this->member = $r->id_adh; + $this->member = (int)$r->id_adh; $this->date = $r->booking_date; - $this->paid = $r->is_paid; + $this->paid = (bool)$r->is_paid; $this->amount = (float)$r->payment_amount; - $this->payment_method = $r->payment_method; + $this->payment_method = (int)$r->payment_method; $this->bank_name = $r->bank_name; $this->check_number = $r->check_number; $this->number_people = $r->number_people; diff --git a/lib/GaletteEvents/Event.php b/lib/GaletteEvents/Event.php index bac8f04..ac27424 100644 --- a/lib/GaletteEvents/Event.php +++ b/lib/GaletteEvents/Event.php @@ -136,7 +136,7 @@ public function load(int $id): bool */ private function loadFromRS(ArrayObject $r): void { - $this->id = $r->id_event; + $this->id = (int)$r->id_event; $this->name = $r->name; $this->address = $r->address; $this->zip = $r->zip; @@ -145,7 +145,7 @@ private function loadFromRS(ArrayObject $r): void $this->begin_date = $r->begin_date; $this->end_date = $r->end_date; $this->creation_date = $r->creation_date; - $this->open = $r->is_open; + $this->open = (bool)$r->is_open; $this->group = $r->id_group; $this->comment = $r->comment; $this->color = $r->color; diff --git a/lib/GaletteEvents/Repository/Bookings.php b/lib/GaletteEvents/Repository/Bookings.php index 2140ba4..d24d186 100644 --- a/lib/GaletteEvents/Repository/Bookings.php +++ b/lib/GaletteEvents/Repository/Bookings.php @@ -425,7 +425,7 @@ private function proceedCount(Select $select): void $results = $this->zdb->execute($countSelect); - $this->count = $results->current()->count; + $this->count = (int)$results->current()->count; if (isset($this->filters) && $this->count > 0) { $this->filters->setCounter($this->count); } diff --git a/lib/GaletteEvents/Repository/Events.php b/lib/GaletteEvents/Repository/Events.php index 8629472..4fbad97 100644 --- a/lib/GaletteEvents/Repository/Events.php +++ b/lib/GaletteEvents/Repository/Events.php @@ -365,7 +365,7 @@ private function proceedCount(Select $select): void $results = $this->zdb->execute($countSelect); if ($result = $results->current()) { - $this->count = $result->count; + $this->count = (int)$result->count; if (isset($this->filters) && $this->count > 0) { $this->filters->setCounter($this->count); }