From df73b9886fd8e93e98467844e2a84e8a80976484 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Mon, 14 Mar 2022 15:47:53 +0100 Subject: [PATCH] Simplify code --- .../ext/ep_products/Classes/Service/HotelDataService.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/public/typo3conf/ext/ep_products/Classes/Service/HotelDataService.php b/public/typo3conf/ext/ep_products/Classes/Service/HotelDataService.php index 12a06d05..29eeba98 100644 --- a/public/typo3conf/ext/ep_products/Classes/Service/HotelDataService.php +++ b/public/typo3conf/ext/ep_products/Classes/Service/HotelDataService.php @@ -140,8 +140,7 @@ class HotelDataService implements SingletonInterface { $hotelUid = $row['hotelUid']; - $hotelCategory = array_key_exists($row['hotelCategory'], Hotel::$categoryLabels) ? - Hotel::$categoryLabels[$row['hotelCategory']] : null; + $hotelCategory = Hotel::$categoryLabels[$row['hotelCategory']] ?? null; if (!array_key_exists($hotelUid, $teasers)) { $teasers[$hotelUid] = [ @@ -199,8 +198,7 @@ class HotelDataService implements SingletonInterface { if (!array_key_exists($row['hotelUid'], $hotels)) { - $hotelCategory = array_key_exists($row['hotelCategory'], Hotel::$categoryLabels) ? - Hotel::$categoryLabels[$row['hotelCategory']] : null; + $hotelCategory = Hotel::$categoryLabels[$row['hotelCategory']] ?? null; $hotels[$row['hotelUid']] = [ 'hotel' => [