From fcd3b5a721b5b1f7e17127ad2ada675f545d7387 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Mon, 18 Sep 2023 14:26:04 -0300 Subject: [PATCH 1/4] Add support for PHP 8.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maurício Meneghini Fauth --- composer.json | 2 +- composer.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 6e78602..3c67b80 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ } }, "require": { - "php": "~8.0.0 || ~8.1.0 || ~8.2.0", + "php": "~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0", "laminas/laminas-json": "^3.1", "laminas/laminas-stdlib": "^3.2" }, diff --git a/composer.lock b/composer.lock index 1294ccb..087ee00 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c5def3a0c3fb04f56c86cd41a7f9744c", + "content-hash": "893a783fdaa1c67c4c38404a31ab4a4b", "packages": [ { "name": "laminas/laminas-json", @@ -2420,7 +2420,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "~8.0.0 || ~8.1.0 || ~8.2.0" + "php": "~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0" }, "platform-dev": [], "platform-overrides": { From 688c3ad71fbb6da47acb9afc8b1b0992ff41a2fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20B=C3=B6sing?= <2189546+boesing@users.noreply.github.com> Date: Sun, 1 Oct 2023 14:45:02 +0200 Subject: [PATCH 2/4] qa: install `igbinary` and `msgpack` for PHP 8.3 via PECL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sury does not (yet) provide those extensions and thus we have to install them via PECL as a fallback. Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com> --- .laminas-ci/pre-install.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 .laminas-ci/pre-install.sh diff --git a/.laminas-ci/pre-install.sh b/.laminas-ci/pre-install.sh new file mode 100755 index 0000000..2325ab8 --- /dev/null +++ b/.laminas-ci/pre-install.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +PHP_VERSION=$4 + +if [ "${PHP_VERSION}" != "8.3" ]; then + exit 0; +fi + +set -e -o pipefail + +pecl install igbinary msgpack + +echo "extension = igbinary.so" > /etc/php/${PHP_VERSION}/mods-available/igbinary.ini +echo "extension = msgpack.so" > /etc/php/${PHP_VERSION}/mods-available/msgpack.ini From 17418fbfc4d1b0a11a756a101d4edb6658ff3538 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20B=C3=B6sing?= <2189546+boesing@users.noreply.github.com> Date: Sun, 1 Oct 2023 17:30:29 +0200 Subject: [PATCH 3/4] qa: ignore platform requirements for PHP 8.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com> --- .laminas-ci.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.laminas-ci.json b/.laminas-ci.json index 63c3417..155c0ae 100644 --- a/.laminas-ci.json +++ b/.laminas-ci.json @@ -3,5 +3,8 @@ "bcmath", "igbinary", "msgpack" - ] + ], + "ignore_php_platform_requirements": { + "8.3": true + } } From 6a6359afc9b1a5129fe2e2ed85b6ca73c46abbd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20B=C3=B6sing?= <2189546+boesing@users.noreply.github.com> Date: Sun, 1 Oct 2023 17:36:40 +0200 Subject: [PATCH 4/4] qa: handle `unserialize` `E_WARNING` which was introduced with PHP 8.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ref: https://wiki.php.net/rfc/unserialize_warn_on_trailing_data Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com> --- src/Adapter/PhpSerialize.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Adapter/PhpSerialize.php b/src/Adapter/PhpSerialize.php index aea0c91..06357e2 100644 --- a/src/Adapter/PhpSerialize.php +++ b/src/Adapter/PhpSerialize.php @@ -21,7 +21,9 @@ use function unserialize; use const E_NOTICE; +use const E_WARNING; use const PHP_MAJOR_VERSION; +use const PHP_VERSION_ID; class PhpSerialize extends AbstractAdapter { @@ -130,7 +132,12 @@ public function unserialize($serialized) return false; } - ErrorHandler::start(E_NOTICE); + $errorLevel = E_NOTICE; + if (PHP_VERSION_ID >= 80300) { + $errorLevel = E_WARNING; + } + + ErrorHandler::start($errorLevel); // The second parameter to unserialize() is only available on PHP 7.0 or higher $ret = PHP_MAJOR_VERSION >= 7