From 6085253019d92c472697de2953db3a691905fbcf Mon Sep 17 00:00:00 2001 From: John Charman <102669158+charjr@users.noreply.github.com> Date: Fri, 30 Jan 2026 13:27:25 +0000 Subject: [PATCH] Handle JSON_ERROR_NON_BACKED_ENUM Handles new constant added since 8.1 (not currently documented in table but [exists here](https://www.php.net/manual/en/json.constants.php#constant.json-error-non-backed-enum) --- src/JsonException.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/JsonException.php b/src/JsonException.php index 6469f85..88615b0 100644 --- a/src/JsonException.php +++ b/src/JsonException.php @@ -22,6 +22,7 @@ class JsonException extends \InvalidArgumentException \JSON_ERROR_UNSUPPORTED_TYPE => 'A value of a type that cannot be encoded was given', \JSON_ERROR_INVALID_PROPERTY_NAME => 'A property name that cannot be encoded was given', \JSON_ERROR_UTF16 => 'Malformed UTF-16 characters, possibly incorrectly encoded', + \JSON_ERROR_NON_BACKED_ENUM => 'Value contains a non-backed enum which cannot be serialized.', ]; /**