Skip to content

Commit

Permalink
[MAINTENANCE] Replace calls of function sizeof by calls of function c…
Browse files Browse the repository at this point in the history
…ount (kitodo#1166)

Signed-off-by: Stefan Weil <[email protected]>
Co-authored-by: Sebastian Meyer <[email protected]>
  • Loading branch information
stweil and sebastian-meyer authored Feb 4, 2024
1 parent 0566944 commit 8d1ee4e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Classes/Controller/BasketController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Classes/Controller/ToolboxController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 8d1ee4e

Please sign in to comment.