Skip to content

Commit 513902f

Browse files
committed
fix compatibility with php 7.2
1 parent ebe8cdb commit 513902f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Body/RequestBody.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ public function toArray(): ?array
3131
}
3232

3333
try {
34-
$content = json_decode($content, true, 512, \JSON_BIGINT_AS_STRING | \JSON_THROW_ON_ERROR);
34+
if (\PHP_VERSION_ID >= 70300) {
35+
$content = json_decode($content, true, 512, \JSON_BIGINT_AS_STRING | \JSON_THROW_ON_ERROR);
36+
} else {
37+
$content = json_decode($content, true, 512, \JSON_BIGINT_AS_STRING);
38+
}
3539
} catch (\JsonException $ex) {
3640
return null;
3741
}

0 commit comments

Comments
 (0)