From 91328441a1ff5d40e9059ce45d84d1ecf1143fb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Mon, 21 Oct 2024 14:00:02 +0200 Subject: [PATCH] Add partial support for PHP 8.4 --- .github/workflows/ci.yml | 5 +++++ CHANGELOG.md | 1 + src/Listener/ConfigureCastorListener.php | 11 ++++++++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b6e0e221..22da77b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,6 +73,11 @@ jobs: castor: bin: 'bin/castor' method: 'bin/castor' + - php: "8.4" + castor: + bin: 'bin/castor' + method: 'bin/castor' + allow_failures: true steps: - name: Checkout diff --git a/CHANGELOG.md b/CHANGELOG.md index 70d15501..b56bf751 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ * Add support for custom php.ini in compile command * Do not validate commande options/args as soon as `#[AsRawTokens] is used * Update all PHP vendor +* Add partial support for PHP 8.4 (`ssh_()` functions are not supported yet) ### Fixes diff --git a/src/Listener/ConfigureCastorListener.php b/src/Listener/ConfigureCastorListener.php index b6e50bd7..2c8179f4 100644 --- a/src/Listener/ConfigureCastorListener.php +++ b/src/Listener/ConfigureCastorListener.php @@ -28,7 +28,7 @@ public function configureCastor(BeforeBootEvent $event): void $this->logger->pushHandler(new ConsoleHandler($this->output)); } - $this->errorHandler->setDefaultLogger($this->logger, [ + $map = [ \E_COMPILE_WARNING => LogLevel::WARNING, \E_CORE_WARNING => LogLevel::WARNING, \E_USER_WARNING => LogLevel::WARNING, @@ -43,8 +43,13 @@ public function configureCastor(BeforeBootEvent $event): void \E_ERROR => LogLevel::ERROR, \E_PARSE => LogLevel::ERROR, \E_RECOVERABLE_ERROR => LogLevel::ERROR, - \E_STRICT => LogLevel::ERROR, \E_USER_ERROR => LogLevel::ERROR, - ]); + ]; + + if (\PHP_VERSION_ID < 80400) { + $map[\E_STRICT] = LogLevel::ERROR; + } + + $this->errorHandler->setDefaultLogger($this->logger, $map); } }