Skip to content

Commit 0e83e1e

Browse files
committed
[JsonEncoder] Use reuse decodeString in NativeDecoder
1 parent aa23093 commit 0e83e1e

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/Symfony/Component/JsonEncoder/Decode/NativeDecoder.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ public static function decodeStream($stream, int $offset = 0, ?int $length = nul
4040
$json = $stream->read($length);
4141
}
4242

43-
try {
44-
return json_decode($json, associative: true, flags: \JSON_THROW_ON_ERROR);
45-
} catch (\JsonException $e) {
46-
throw new UnexpectedValueException('JSON is not valid: '.$e->getMessage());
47-
}
43+
return self::decodeString($json);
4844
}
4945
}

0 commit comments

Comments
 (0)