Skip to content

Commit

Permalink
Fix typehint
Browse files Browse the repository at this point in the history
  • Loading branch information
trasher committed Jun 5, 2024
1 parent fc70ea1 commit 7312b2d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions lib/GaletteEvents/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -384,7 +384,7 @@ public function countEvents(): int
$results = $this->zdb->execute($select);
$result = $results->current();
$count = $result->counter;
return $count;
return (int)$count;
}

/**
Expand Down
8 changes: 4 additions & 4 deletions lib/GaletteEvents/Booking.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions lib/GaletteEvents/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/GaletteEvents/Repository/Bookings.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/GaletteEvents/Repository/Events.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 7312b2d

Please sign in to comment.