Simplify code

This commit is contained in:
Björn Fromme
2022-03-14 15:47:53 +01:00
parent 3e1f7ff96e
commit df73b9886f
@@ -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' => [