X-Git-Url: https://yaffs.net/gitweb/?a=blobdiff_plain;f=vendor%2Fsymfony%2Fhttp-foundation%2FJsonResponse.php;h=a83d0077a84293b58fc6dd58a9b02a0733f5ccda;hb=3f4e21847e67242d3000b01156783f25594f7333;hp=2412b5e2b4bf5ca95fad3975ff027d91a66c5e49;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/vendor/symfony/http-foundation/JsonResponse.php b/vendor/symfony/http-foundation/JsonResponse.php index 2412b5e2b..a83d0077a 100644 --- a/vendor/symfony/http-foundation/JsonResponse.php +++ b/vendor/symfony/http-foundation/JsonResponse.php @@ -121,7 +121,7 @@ class JsonResponse extends Response $data = json_encode($data, $this->encodingOptions); } else { try { - if (PHP_VERSION_ID < 50400) { + if (\PHP_VERSION_ID < 50400) { // PHP 5.3 triggers annoying warnings for some // types that can't be serialized as JSON (INF, resources, etc.) // but doesn't provide the JsonSerializable interface. @@ -131,7 +131,7 @@ class JsonResponse extends Response // PHP 5.4 and up wrap exceptions thrown by JsonSerializable // objects in a new exception that needs to be removed. // Fortunately, PHP 5.5 and up do not trigger any warning anymore. - if (PHP_VERSION_ID < 50500) { + if (\PHP_VERSION_ID < 50500) { // Clear json_last_error() json_encode(null); $errorHandler = set_error_handler('var_dump'); @@ -146,14 +146,14 @@ class JsonResponse extends Response $data = json_encode($data, $this->encodingOptions); } - if (PHP_VERSION_ID < 50500) { + if (\PHP_VERSION_ID < 50500) { restore_error_handler(); } } catch (\Exception $e) { - if (PHP_VERSION_ID < 50500) { + if (\PHP_VERSION_ID < 50500) { restore_error_handler(); } - if (PHP_VERSION_ID >= 50400 && 'Exception' === get_class($e) && 0 === strpos($e->getMessage(), 'Failed calling ')) { + if (\PHP_VERSION_ID >= 50400 && 'Exception' === get_class($e) && 0 === strpos($e->getMessage(), 'Failed calling ')) { throw $e->getPrevious() ?: $e; } throw $e;