From f93b834af9a9f33c822f517d8aaac4c2be6e7b1f Mon Sep 17 00:00:00 2001 From: Igor Manjencic Date: Thu, 23 Jan 2025 13:09:39 +0100 Subject: [PATCH] feat(ZMS-3460): fix tests --- .../Availability/AvailableAppointmentsListService.php | 6 +++--- .../Services/Availability/AvailableDaysListService.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/zmscitizenapi/src/Zmscitizenapi/Services/Availability/AvailableAppointmentsListService.php b/zmscitizenapi/src/Zmscitizenapi/Services/Availability/AvailableAppointmentsListService.php index ebcf247b0..d15fcf382 100644 --- a/zmscitizenapi/src/Zmscitizenapi/Services/Availability/AvailableAppointmentsListService.php +++ b/zmscitizenapi/src/Zmscitizenapi/Services/Availability/AvailableAppointmentsListService.php @@ -26,13 +26,13 @@ private function extractClientData(array $queryParams): object return (object) [ 'date' => isset($queryParams['date']) ? (string) $queryParams['date'] : null, 'officeIds' => isset($queryParams['officeId']) - ? array_map('trim', explode(',', $queryParams['officeId'])) + ? array_map('trim', explode(',', (string) $queryParams['officeId'])) : [], 'serviceIds' => isset($queryParams['serviceId']) - ? array_map('trim', explode(',', $queryParams['serviceId'])) + ? array_map('trim', explode(',', (string) $queryParams['serviceId'])) : [], 'serviceCounts' => isset($queryParams['serviceCount']) - ? array_map('trim', explode(',', $queryParams['serviceCount'])) + ? array_map('trim', explode(',', (string) $queryParams['serviceCount'])) : [] ]; } diff --git a/zmscitizenapi/src/Zmscitizenapi/Services/Availability/AvailableDaysListService.php b/zmscitizenapi/src/Zmscitizenapi/Services/Availability/AvailableDaysListService.php index d0abae9b4..516628a02 100644 --- a/zmscitizenapi/src/Zmscitizenapi/Services/Availability/AvailableDaysListService.php +++ b/zmscitizenapi/src/Zmscitizenapi/Services/Availability/AvailableDaysListService.php @@ -25,12 +25,12 @@ private function extractClientData(array $queryParams): object { $serviceCount = $queryParams['serviceCount'] ?? ''; $serviceCounts = !empty($serviceCount) - ? array_map('trim', explode(',', $serviceCount)) + ? array_map('trim', explode(',', (string) $serviceCount)) : []; return (object) [ - 'officeIds' => array_map('trim', explode(',', $queryParams['officeId'] ?? '')), - 'serviceIds' => array_map('trim', explode(',', $queryParams['serviceId'] ?? '')), + 'officeIds' => array_map('trim', explode(',', (string) $queryParams['officeId'] ?? '')), + 'serviceIds' => array_map('trim', explode(',', (string) $queryParams['serviceId'] ?? '')), 'serviceCounts' => $serviceCounts, 'startDate' => $queryParams['startDate'] ?? null, 'endDate' => $queryParams['endDate'] ?? null