Skip to content

Commit

Permalink
fix: prevent psalm error
Browse files Browse the repository at this point in the history
Prevent the follow error:

```
ERROR: InvalidPassByReference - 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 committed Apr 5, 2024
1 parent 589a3c7 commit 6f7c88e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion doc/Usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ foreach ($pages as $page) {
$details = $page->getDetails();
// The page could haven't the Mediabox, then we get this information from document
if (!isset($details['MediaBox'])) {
$details = reset($pdf->getObjectsByType('Pages'))->getHeader()->getDetails();
$pages = $pdf->getObjectsByType('Pages');
$details = reset($pages)->getHeader()->getDetails();
}
$mediaBox[] = [
'width' => $details['MediaBox'][2],
Expand Down

0 comments on commit 6f7c88e

Please sign in to comment.