From a1b29eec189c85d5dcb29b79d9a4d9331996939c Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Fri, 30 Oct 2026 10:50:58 +0300 Subject: [PATCH 1/3] PHP 8.6 support --- .github/CONTRIBUTING.md | 2 +- .github/workflows/build.yml | 1 + .github/workflows/composer-dependency-analyser.yml | 1 + .github/workflows/mutation.yml | 2 +- .github/workflows/static.yml | 1 + CHANGELOG.md | 3 ++- README.md | 2 +- composer.json | 2 +- 8 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index ed00b974..89f6d7a8 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -10,7 +10,7 @@ For questions and discussion, use the author's [Telegram chat](https://t.me/pred ## Development setup -Requirements: 64-bit PHP 8.2–8.5 and [Composer](https://getcomposer.org/download/). +Requirements: 64-bit PHP 8.2–8.6 and [Composer](https://getcomposer.org/download/). Fork the repository, clone it and run `composer install`. diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a3b1a353..d71352eb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,6 +28,7 @@ jobs: - "8.3" - "8.4" - "8.5" + - "8.6" steps: - name: Checkout diff --git a/.github/workflows/composer-dependency-analyser.yml b/.github/workflows/composer-dependency-analyser.yml index 22bf2b38..f41a82cf 100644 --- a/.github/workflows/composer-dependency-analyser.yml +++ b/.github/workflows/composer-dependency-analyser.yml @@ -27,6 +27,7 @@ jobs: - "8.3" - "8.4" - "8.5" + - "8.6" steps: - name: Checkout. diff --git a/.github/workflows/mutation.yml b/.github/workflows/mutation.yml index 877af238..25351e43 100644 --- a/.github/workflows/mutation.yml +++ b/.github/workflows/mutation.yml @@ -25,7 +25,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - php: ["8.5"] + php: ["8.6"] steps: - name: Checkout diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 446dc388..30af6ebc 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -28,6 +28,7 @@ jobs: - "8.3" - "8.4" - "8.5" + - "8.6" steps: - name: Checkout diff --git a/CHANGELOG.md b/CHANGELOG.md index a6ac7aa6..2e8289b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,13 +4,14 @@ - Enh #223: Convert the PHP warning raised on failure to read a local file in `NativeTransport` into an exception with the original error message. +- Enh #229: Replace Psalm with PHPStan for static analysis. +- Enh #230: Add PHP 8.6 support. - Bug #227: Throw `InvalidArgumentException` on serialization of rich text that contains an element other than a string, a `RichText` object or an array of them, instead of failing with `TypeError` or silently casting scalars to strings. - Bug #227: Discard keys of rich text arrays on serialization, so they are always sent as JSON arrays, not objects. - Bug #228: Fix "Undefined array key" error in `InputFile::filename()` and `CurlTransport` when a stream resource has no URI. -- Enh #229: Replace Psalm with PHPStan for static analysis. ## 0.22 August 25, 2026 diff --git a/README.md b/README.md index 3482a3fd..e19b89fa 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ The package provides a simple and convenient way to interact with the Telegram B ## Requirements -- PHP (64-bit) 8.2 - 8.5. +- PHP (64-bit) 8.2 - 8.6. ## Installation diff --git a/composer.json b/composer.json index 6d2557e8..2c3affce 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ } ], "require": { - "php-64bit": "8.2 - 8.5" + "php-64bit": "8.2 - 8.6" }, "require-dev": { "ext-curl": "*", From e55a3af750c2adf9f8cc18597b769ec0847a0631 Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Fri, 30 Oct 2026 10:57:29 +0300 Subject: [PATCH 2/3] fix test --- tests/Transport/NativeTransport/NativeTransportTest.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/Transport/NativeTransport/NativeTransportTest.php b/tests/Transport/NativeTransport/NativeTransportTest.php index 56803890..e4109812 100644 --- a/tests/Transport/NativeTransport/NativeTransportTest.php +++ b/tests/Transport/NativeTransport/NativeTransportTest.php @@ -18,6 +18,7 @@ use function PHPUnit\Framework\assertSame; use function PHPUnit\Framework\assertStringContainsString; use function PHPUnit\Framework\assertTrue; +use function sprintf; final class NativeTransportTest extends TestCase { @@ -239,7 +240,11 @@ public function testReadNonExistentFileThrowsException(): void $this->expectException(RuntimeException::class); $this->expectExceptionMessage( - "Failed to read the file $nonExistentPath. file_get_contents($nonExistentPath): Failed to open stream: No such file or directory", + sprintf( + 'Failed to read the file %s. %s: Failed to open stream: No such file or directory', + $nonExistentPath, + PHP_VERSION_ID >= 80600 ? 'file_get_contents()' : "file_get_contents()", + ), ); $transport->postWithFiles( 'http://url/method', From 5588c2bc5cefb53a51d9838f5017e6820439ef82 Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Fri, 30 Oct 2026 11:07:21 +0300 Subject: [PATCH 3/3] fix test --- tests/Transport/NativeTransport/NativeTransportTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Transport/NativeTransport/NativeTransportTest.php b/tests/Transport/NativeTransport/NativeTransportTest.php index e4109812..cf92f826 100644 --- a/tests/Transport/NativeTransport/NativeTransportTest.php +++ b/tests/Transport/NativeTransport/NativeTransportTest.php @@ -243,7 +243,7 @@ public function testReadNonExistentFileThrowsException(): void sprintf( 'Failed to read the file %s. %s: Failed to open stream: No such file or directory', $nonExistentPath, - PHP_VERSION_ID >= 80600 ? 'file_get_contents()' : "file_get_contents()", + PHP_VERSION_ID >= 80600 ? 'file_get_contents()' : "file_get_contents($nonExistentPath)", ), ); $transport->postWithFiles(