Skip to content

Commit c4fa462

Browse files
committed
Merge pull request #5 from aws/fix/support-php7-json_decode
Squash two errors from `fromRawPostData` into one
2 parents 3eceaba + e477253 commit c4fa462

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/Message.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@ public static function fromRawPostData()
5353
}
5454

5555
$data = json_decode(file_get_contents('php://input'), true);
56-
if (JSON_ERROR_NONE !== json_last_error()) {
57-
throw new \InvalidArgumentException('Unable to parse JSON.');
58-
} elseif (!is_array($data)) {
56+
if (JSON_ERROR_NONE !== json_last_error() || !is_array($data)) {
5957
throw new \RuntimeException('Invalid POST data.');
6058
}
6159

0 commit comments

Comments
 (0)