Skip to content

Commit 74bfbef

Browse files
committed
Fix phpstan
1 parent 9f16cec commit 74bfbef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Hydra/Serializer/PartialCollectionViewNormalizer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ public function normalize($object, $format = null, array $context = [])
9191

9292
$data['hydra:view']['@id'] = IriHelper::createIri($parsed['parts'], $parsed['parameters']);
9393

94-
if (false !== $lastObject) {
94+
if (false !== $lastObject && isset($cursorPaginationAttribute)) {
9595
$data['hydra:view']['hydra:next'] = IriHelper::createIri($parsed['parts'], array_merge($parsed['parameters'], $this->cursorPaginationFields($cursorPaginationAttribute, 1, $lastObject)));
9696
}
9797

98-
if (false !== $firstObject) {
98+
if (false !== $firstObject && isset($cursorPaginationAttribute)) {
9999
$data['hydra:view']['hydra:previous'] = IriHelper::createIri($parsed['parts'], array_merge($parsed['parameters'], $this->cursorPaginationFields($cursorPaginationAttribute, -1, $firstObject)));
100100
}
101101
} elseif ($paginated) {

0 commit comments

Comments
 (0)