From 02b6c978809b109a5afe8da004f3f6a4c035103f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Sat, 19 Apr 2025 13:12:14 +0200 Subject: [PATCH 1/2] Full support for PHP 8.1 and PHP 8.0 --- .github/workflows/ci.yml | 2 ++ README.md | 2 +- tests/unit/AbstractConnectionDecoratorTest.php | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b99b47e..5b9eba24 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,8 @@ jobs: - "7.2" - "7.3" - "7.4" + - "8.0" + - "8.1" dependencies: - "highest" include: diff --git a/README.md b/README.md index fb995b43..1b3a879b 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ composer require cboden/ratchet:^0.4.4 See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades. This project aims to run on any platform and thus does not require any PHP -extensions and supports running on legacy PHP 5.4 through PHP 7.4+ with limited support for PHP 8+. +extensions and supports running on legacy PHP 5.4 through PHP 8.1+ with limited support for PHP 8.2+. It's *highly recommended to use the latest supported PHP version* for this project. See above note about [Reviving Ratchet](#reviving-ratchet) for newer PHP support. diff --git a/tests/unit/AbstractConnectionDecoratorTest.php b/tests/unit/AbstractConnectionDecoratorTest.php index b3131d2e..ddb0b83d 100644 --- a/tests/unit/AbstractConnectionDecoratorTest.php +++ b/tests/unit/AbstractConnectionDecoratorTest.php @@ -138,7 +138,7 @@ public function testWarningGettingNothing() { $error = false; set_error_handler(function () use (&$error) { $error = true; - }, E_NOTICE); + }, PHP_VERSION_ID >= 80000 ? E_WARNING : E_NOTICE); $var = $this->mock->nonExistant; @@ -152,7 +152,7 @@ public function testWarningGettingNothingLevel1() { $error = false; set_error_handler(function () use (&$error) { $error = true; - }, E_NOTICE); + }, PHP_VERSION_ID >= 80000 ? E_WARNING : E_NOTICE); $var = $this->l1->nonExistant; @@ -166,7 +166,7 @@ public function testWarningGettingNothingLevel2() { $error = false; set_error_handler(function () use (&$error) { $error = true; - }, E_NOTICE); + }, PHP_VERSION_ID >= 80000 ? E_WARNING : E_NOTICE); $var = $this->l2->nonExistant; From af3f6178b20b4f8439ea55756ae2f8e9893b08c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Sun, 20 Apr 2025 17:05:32 +0200 Subject: [PATCH 2/2] Temporarily pin symfony/http-foundation to < 6 to fix tests on PHP 8+ --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d9ce25fe..fce58942 100644 --- a/composer.json +++ b/composer.json @@ -35,6 +35,7 @@ , "symfony/routing": "^2.6|^3.0|^4.0|^5.0|^6.0" } , "require-dev": { - "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "symfony/http-foundation": "^2.6|^3.0|^4.0|^5.0" } }