Skip to content

Commit 5ca55ec

Browse files
committed
Fix error in Response::getLinks method
1 parent b769763 commit 5ca55ec

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/Response.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,11 @@ public function getStatus() : string
189189
public function getLinks() : array
190190
{
191191
$link = $this->getHeader(Header::LINK);
192+
$result = [];
192193
if ($link) {
193-
$link = $this->parseLinkHeader($link);
194+
$result = $this->parseLinkHeader($link);
194195
}
195-
return (array) $link; // @phpstan-ignore-line
196+
return $result;
196197
}
197198

198199
/**

tests/ResponseTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ public function linksProvider() : array
163163
'foo',
164164
[],
165165
],
166+
[
167+
'0',
168+
[],
169+
],
166170
];
167171
}
168172

0 commit comments

Comments
 (0)