From 343aa2445045a4b3f551faa3766bbeef3b6f47c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Mon, 16 Dec 2024 09:45:01 +0100 Subject: [PATCH] fix: avoid type error --- src/Service/Teamer/PickupResolver.php | 4 ++-- src/Twig/AppRuntime.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Service/Teamer/PickupResolver.php b/src/Service/Teamer/PickupResolver.php index 2542dc3..2a3bf2f 100644 --- a/src/Service/Teamer/PickupResolver.php +++ b/src/Service/Teamer/PickupResolver.php @@ -23,8 +23,8 @@ class PickupResolver return false; } - $teamerPickups = array_map(function (int $id) { - return $this->pickupDataProvider->get($id); + $teamerPickups = array_map(function (mixed $id) { + return $this->pickupDataProvider->get((int) $id); }, $teamer->getPickups()); foreach ($teamerPickups as $teamerPickup) { diff --git a/src/Twig/AppRuntime.php b/src/Twig/AppRuntime.php index aee00db..d3afdfd 100644 --- a/src/Twig/AppRuntime.php +++ b/src/Twig/AppRuntime.php @@ -88,9 +88,9 @@ class AppRuntime implements RuntimeExtensionInterface return 'ab '.$pickup->getCity(); } - public function hasPickup($pickupId, Teamer $teamer): bool + public function hasPickup(?int $pickupId, Teamer $teamer): bool { - return $this->pickupResolver->hasPickup((int) $pickupId, $teamer); + return $this->pickupResolver->hasPickup($pickupId, $teamer); } public function fileIconFilter(Environment $environment, string $mimeType, ?string $classes = 'w-4 h-4'): string