diff --git a/Classes/Controller/ListViewController.php b/Classes/Controller/ListViewController.php index 75944bff9..93cbbae23 100644 --- a/Classes/Controller/ListViewController.php +++ b/Classes/Controller/ListViewController.php @@ -88,10 +88,7 @@ public function mainAction(): void } // Get current page from request data because the parameter is shared between plugins - $currentPage = $this->requestData['page']; - if (empty($currentPage)) { - $currentPage = 1; - } + $currentPage = $this->requestData['page'] ?? 1; // get all sortable metadata records $sortableMetadata = $this->metadataRepository->findByIsSortable(true); diff --git a/Classes/Controller/PageGridController.php b/Classes/Controller/PageGridController.php index 539d0b66b..b3fb67fcd 100644 --- a/Classes/Controller/PageGridController.php +++ b/Classes/Controller/PageGridController.php @@ -54,10 +54,7 @@ public function mainAction(): void } // Get current page from request data because the parameter is shared between plugins - $currentPage = $this->requestData['page']; - if (empty($currentPage)) { - $currentPage = 1; - } + $currentPage = $this->requestData['page'] ?? 1; $itemsPerPage = $this->settings['paginate']['itemsPerPage']; if (empty($itemsPerPage)) { diff --git a/Classes/Format/Mods.php b/Classes/Format/Mods.php index 9a4ced0cd..271ae88c7 100644 --- a/Classes/Format/Mods.php +++ b/Classes/Format/Mods.php @@ -325,7 +325,7 @@ private function getPlaces(): void if (!empty($places)) { foreach ($places as $place) { $this->metadata['place'][] = $place; - if (!$this->metadata['place_sorting'][0]) { + if (empty($this->metadata['place_sorting'][0])) { $this->metadata['place_sorting'][0] = preg_replace('/[[:punct:]]/', '', $place); } } @@ -363,7 +363,7 @@ private function getYears(): void $issued = $year->getIssuedDates(); if (!empty($issued)) { $this->metadata['year'][] = $issued[0]->getValue(); - if (!$this->metadata['year_sorting'][0]) { + if (empty($this->metadata['year_sorting'][0])) { $yearSorting = str_ireplace('x', '5', preg_replace('/[^\d.x]/i', '', $issued[0]->getValue())); if ( strpos($yearSorting, '.')