Use JSON_THROW_ON_ERROR for json_encode() and json_decode()

This commit is contained in:
Dylan K. Taylor
2021-12-08 19:14:07 +00:00
parent c6466a6da9
commit 8b73549355
9 changed files with 20 additions and 51 deletions

View File

@ -29,6 +29,7 @@ use function in_array;
use function json_encode;
use function json_last_error_msg;
use function strlen;
use const JSON_THROW_ON_ERROR;
final class Skin{
public const ACCEPTED_SKIN_SIZES = [
@ -73,7 +74,7 @@ final class Skin{
* Not only that, they are pretty-printed.
* TODO: find out what model crap can be safely dropped from the packet (unless it gets fixed first)
*/
$geometryData = json_encode($decodedGeometry);
$geometryData = json_encode($decodedGeometry, JSON_THROW_ON_ERROR);
}
$this->skinId = $skinId;