Skip to content

Commit

Permalink
fix: prevent psalm error
Browse files Browse the repository at this point in the history
```
ERROR: InvalidPassByReference - lib/Service/PdfParserService.php:76:22 - Parameter 1 of reset expects a variable (see https://psalm.dev/102)
				$details = reset($pdf->getObjectsByType('Pages'))->getHeader()->getDetails();
```

Signed-off-by: Vitor Mattos <[email protected]>
  • Loading branch information
vitormattos authored and backportbot-libresign[bot] committed Apr 5, 2024
1 parent 486023c commit 756f1ff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Service/PdfParserService.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ private function parsePdfOnlyWithPhp(string $filename): array {
foreach ($pages as $page) {
$details = $page->getDetails();
if (!isset($details['MediaBox'])) {
$details = reset($pdf->getObjectsByType('Pages'))->getHeader()->getDetails();
$pages = $pdf->getObjectsByType('Pages');
$details = reset($pages)->getHeader()->getDetails();
}
$output['d'][] = [
'w' => $details['MediaBox'][2],
Expand Down

0 comments on commit 756f1ff

Please sign in to comment.