Skip to content

Commit 5810626

Browse files
Merge pull request #7 from digistorm/hotfix/PSYS-93-fix-get-data-strict-type
[PSYS-93] Fix getData strict array type problem when data is a string
2 parents a3107e5 + a8838db commit 5810626

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Message/AbstractResponse.php

+4
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ public function getDataItem(string $key): bool|string|int|float|null
6161
*/
6262
public function getData(): array
6363
{
64+
// Sometimes the response is html, and in that case we don't process it.
65+
if (is_string($this->data)) {
66+
return [];
67+
}
6468
return $this->data;
6569
}
6670

0 commit comments

Comments
 (0)