From 7990657237fcc4845a75aa922b7a7aa1e5577088 Mon Sep 17 00:00:00 2001 From: Tac Tacelosky Date: Fri, 20 Nov 2026 08:19:37 -0500 Subject: [PATCH] Support PHP 8.6 Allow PHP 8.6 in composer.json. PHP 8.6 appends " near location L:C" to json_decode error messages, so two tests now match the start of the message instead of the whole string. Co-Authored-By: Claude Sonnet 5.5 --- CHANGELOG.md | 2 +- composer.json | 2 +- test/JsonMachineTest/JsonDecoder/ErrorWrappingDecoderTest.php | 2 +- test/JsonMachineTest/JsonDecoder/ExtJsonDecoderTest.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6514687..cade051 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## master -Nothing yet +- Support for PHP 8.6
diff --git a/composer.json b/composer.json index 7aafac7..cce980c 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "sort-packages": true }, "require": { - "php": "7.2 - 8.5" + "php": "7.2 - 8.6" }, "require-dev": { "ext-json": "*", diff --git a/test/JsonMachineTest/JsonDecoder/ErrorWrappingDecoderTest.php b/test/JsonMachineTest/JsonDecoder/ErrorWrappingDecoderTest.php index 825a901..295561f 100644 --- a/test/JsonMachineTest/JsonDecoder/ErrorWrappingDecoderTest.php +++ b/test/JsonMachineTest/JsonDecoder/ErrorWrappingDecoderTest.php @@ -79,6 +79,6 @@ public function testCatchesErrorInsideIteratedJsonChunk() $decodingError = $result[1]; $this->assertInstanceOf(DecodingError::class, $decodingError); $this->assertSame('{"incorrect":nulll}', $decodingError->getMalformedJson()); - $this->assertSame('Syntax error', $decodingError->getErrorMessage()); + $this->assertStringStartsWith('Syntax error', $decodingError->getErrorMessage()); // PHP 8.6 appends " near location L:C" } } diff --git a/test/JsonMachineTest/JsonDecoder/ExtJsonDecoderTest.php b/test/JsonMachineTest/JsonDecoder/ExtJsonDecoderTest.php index 9a7ef6a..9a9d0d5 100644 --- a/test/JsonMachineTest/JsonDecoder/ExtJsonDecoderTest.php +++ b/test/JsonMachineTest/JsonDecoder/ExtJsonDecoderTest.php @@ -48,7 +48,7 @@ public function testPassesPassesDepthOptionToJsonDecode() $depthDecoder = new ExtJsonDecoder(true, 1); $depthResult = $depthDecoder->decode($json); $this->assertFalse($depthResult->isOk()); - $this->assertSame('Maximum stack depth exceeded', $depthResult->getErrorMessage()); + $this->assertStringStartsWith('Maximum stack depth exceeded', $depthResult->getErrorMessage()); // PHP 8.6 appends " near location L:C" } public function testPassesPassesBigIntOptionToJsonDecode()