Skip to content

Commit d693dc2

Browse files
author
Анатолий Нехай
committed
fix for php 7.1
1 parent 073bd9b commit d693dc2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Middleware/JsonPayloadDecodingMiddleware.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class JsonPayloadDecodingMiddleware implements MiddlewareInterface
6161
*
6262
* @link https://www.php.net/manual/ru/json.constants.php
6363
*/
64-
protected const JSON_DECODING_OPTIONS = JSON_BIGINT_AS_STRING|JSON_OBJECT_AS_ARRAY;
64+
protected const JSON_DECODING_OPTIONS = JSON_BIGINT_AS_STRING;
6565

6666
/**
6767
* {@inheritdoc}
@@ -128,7 +128,7 @@ private function getRequestMediaType(ServerRequestInterface $request) : ?string
128128
private function decodeRequestJsonPayload(ServerRequestInterface $request)
129129
{
130130
json_decode('');
131-
$result = json_decode($request->getBody()->__toString(), null, 512, static::JSON_DECODING_OPTIONS);
131+
$result = json_decode($request->getBody()->__toString(), true, 512, static::JSON_DECODING_OPTIONS);
132132
if (JSON_ERROR_NONE === json_last_error()) {
133133
return $result;
134134
}

0 commit comments

Comments
 (0)