From 8d1ee4e2b278d2f0e39d2a8f586383be9eca04a3 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sun, 4 Feb 2024 14:04:39 +0100 Subject: [PATCH] [MAINTENANCE] Replace calls of function sizeof by calls of function count (#1166) Signed-off-by: Stefan Weil Co-authored-by: Sebastian Meyer --- Classes/Controller/BasketController.php | 2 +- Classes/Controller/ToolboxController.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/Controller/BasketController.php b/Classes/Controller/BasketController.php index e1ba0f8dc..e3e3ced84 100644 --- a/Classes/Controller/BasketController.php +++ b/Classes/Controller/BasketController.php @@ -438,7 +438,7 @@ protected function addToBasket(array $piVars, Basket $basket): ?Basket // set endpage for toc and subentry based on logid if (($piVars['addToBasket'] == 'subentry') or ($piVars['addToBasket'] == 'toc')) { $smLinks = $this->document->getCurrentDocument()->smLinks; - $pageCounter = sizeof($smLinks['l2p'][$piVars['logId']]); + $pageCounter = count($smLinks['l2p'][$piVars['logId']]); $documentItem['endpage'] = ($documentItem['startpage'] + $pageCounter) - 1; } // add whole document diff --git a/Classes/Controller/ToolboxController.php b/Classes/Controller/ToolboxController.php index 7455cbc15..46de9856b 100644 --- a/Classes/Controller/ToolboxController.php +++ b/Classes/Controller/ToolboxController.php @@ -139,7 +139,7 @@ private function renderAnnotationTool(): void $annotationContainers = $this->currentDocument->physicalStructureInfo[$this->currentDocument->physicalStructure[$this->requestData['page']]]['annotationContainers']; if ( $annotationContainers != null - && sizeof($annotationContainers) > 0 + && count($annotationContainers) > 0 ) { $this->view->assign('annotationTool', true); } else {