From 5c336fa00f6cff60a634c4798f2d0f66d86c52d3 Mon Sep 17 00:00:00 2001 From: marko-krueger Date: Thu, 19 Jun 2025 17:19:29 +0200 Subject: [PATCH 1/4] fix: symfony 7.3 setCode call and php8.4 deprecation warnings --- CHANGELOG.md | 5 +++++ src/Command/BackgroundCommand.php | 5 +++-- src/Command/DaemonCommand.php | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef8139b..4dffbb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +## [5.0.0] - 2025-06-19 +### Changed +- fix for symfony/console setCode() call +- fix for PHP 8.4 deprecation warnings + ## [4.0.1] - 2025-01-21 ### Changed - Allow Symfony v7 dependencies diff --git a/src/Command/BackgroundCommand.php b/src/Command/BackgroundCommand.php index 3e98581..d87ab1b 100644 --- a/src/Command/BackgroundCommand.php +++ b/src/Command/BackgroundCommand.php @@ -24,11 +24,12 @@ class BackgroundCommand extends Command */ private $backgroundExecute; - public function __construct(string $name = null) + public function __construct(?string $name = null) { parent::__construct($name); - parent::setCode([$this, 'background']); + parent::setCode(fn ($input, $output) => $this->background($input, $output)); + $this->backgroundExecute = [$this, 'execute']; // add stop signals diff --git a/src/Command/DaemonCommand.php b/src/Command/DaemonCommand.php index d99ca5f..ecca4c6 100644 --- a/src/Command/DaemonCommand.php +++ b/src/Command/DaemonCommand.php @@ -16,7 +16,7 @@ */ class DaemonCommand extends BackgroundCommand { - public function __construct(string $name = null) + public function __construct(?string $name = null) { parent::__construct($name); $this->configureDaemon(); From 96a7cc753a84355427848c5087f2dcad70f006a2 Mon Sep 17 00:00:00 2001 From: Chris Minett <1084019+chrisminett@users.noreply.github.com> Date: Fri, 20 Jun 2025 11:28:20 +0100 Subject: [PATCH 2/4] ECS fix --- src/Command/BackgroundCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Command/BackgroundCommand.php b/src/Command/BackgroundCommand.php index d87ab1b..81a77e7 100644 --- a/src/Command/BackgroundCommand.php +++ b/src/Command/BackgroundCommand.php @@ -28,7 +28,7 @@ public function __construct(?string $name = null) { parent::__construct($name); - parent::setCode(fn ($input, $output) => $this->background($input, $output)); + parent::setCode(fn($input, $output) => $this->background($input, $output)); $this->backgroundExecute = [$this, 'execute']; From 31e6f1353c242ce3518be5987185b759e07f4617 Mon Sep 17 00:00:00 2001 From: marko-krueger Date: Mon, 23 Jun 2025 08:35:28 +0200 Subject: [PATCH 3/4] remove versioning --- CHANGELOG.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4dffbb2..ef8139b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,11 +6,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] -## [5.0.0] - 2025-06-19 -### Changed -- fix for symfony/console setCode() call -- fix for PHP 8.4 deprecation warnings - ## [4.0.1] - 2025-01-21 ### Changed - Allow Symfony v7 dependencies From 021a74a138c0409d84dce182dbda4cf9002dc772 Mon Sep 17 00:00:00 2001 From: marko-krueger Date: Thu, 26 Jun 2025 12:17:58 +0200 Subject: [PATCH 4/4] change parent::setCode to use Closure::fromCallable --- src/Command/BackgroundCommand.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Command/BackgroundCommand.php b/src/Command/BackgroundCommand.php index 81a77e7..1823e8f 100644 --- a/src/Command/BackgroundCommand.php +++ b/src/Command/BackgroundCommand.php @@ -27,8 +27,7 @@ class BackgroundCommand extends Command public function __construct(?string $name = null) { parent::__construct($name); - - parent::setCode(fn($input, $output) => $this->background($input, $output)); + parent::setCode(\Closure::fromCallable([$this, 'background'])); $this->backgroundExecute = [$this, 'execute'];