From 3ca583cc9c279c51d24ae4c6103c6807706c1a94 Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Tue, 7 Apr 2026 22:55:39 +0100 Subject: [PATCH 1/3] tweak: return int rather than exit --- composer.json | 2 +- composer.lock | 101 ++++++++++++++++++++------------------- src/Cli/StartCommand.php | 6 ++- 3 files changed, 56 insertions(+), 53 deletions(-) diff --git a/composer.json b/composer.json index 8d9754e..84e351c 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,7 @@ ], "require": { - "php": ">=8.0", + "php": ">=8.2", "phpgt/cli": "^1.3.5" }, "require-dev": { diff --git a/composer.lock b/composer.lock index b615835..feffcad 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f9d336bd02ba0f068be69973425afefc", + "content-hash": "0f8704d10f21e40e11784a453c4c1716", "packages": [ { "name": "phpgt/cli", - "version": "v1.3.5", + "version": "v1.4.0", "source": { "type": "git", - "url": "https://github.com/PhpGt/Cli.git", - "reference": "42aeef24ab9789907358002fdcc37cb3a2e26b4b" + "url": "https://github.com/phpgt/Cli.git", + "reference": "84a1b720efe836624313061ac42e81dd7d9c2948" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PhpGt/Cli/zipball/42aeef24ab9789907358002fdcc37cb3a2e26b4b", - "reference": "42aeef24ab9789907358002fdcc37cb3a2e26b4b", + "url": "https://api.github.com/repos/phpgt/Cli/zipball/84a1b720efe836624313061ac42e81dd7d9c2948", + "reference": "84a1b720efe836624313061ac42e81dd7d9c2948", "shasum": "" }, "require": { @@ -56,8 +56,8 @@ "webengine" ], "support": { - "issues": "https://github.com/PhpGt/Cli/issues", - "source": "https://github.com/PhpGt/Cli/tree/v1.3.5" + "issues": "https://github.com/phpgt/Cli/issues", + "source": "https://github.com/phpgt/Cli/tree/v1.4.0" }, "funding": [ { @@ -65,20 +65,20 @@ "type": "github" } ], - "time": "2024-05-08T17:45:44+00:00" + "time": "2026-03-08T23:28:56+00:00" }, { "name": "phpgt/daemon", - "version": "v1.1.4", + "version": "v1.1.5", "source": { "type": "git", - "url": "https://github.com/PhpGt/Daemon.git", - "reference": "4609225cf82a1f13a5f7364870a2b5f52c6a2529" + "url": "https://github.com/phpgt/Daemon.git", + "reference": "413e16b54de6e1fd5c2b646b485f88a86dfedd9a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PhpGt/Daemon/zipball/4609225cf82a1f13a5f7364870a2b5f52c6a2529", - "reference": "4609225cf82a1f13a5f7364870a2b5f52c6a2529", + "url": "https://api.github.com/repos/phpgt/Daemon/zipball/413e16b54de6e1fd5c2b646b485f88a86dfedd9a", + "reference": "413e16b54de6e1fd5c2b646b485f88a86dfedd9a", "shasum": "" }, "require": { @@ -100,8 +100,8 @@ "notification-url": "https://packagist.org/downloads/", "description": "Background script execution with cross-platform compatible streaming.", "support": { - "issues": "https://github.com/PhpGt/Daemon/issues", - "source": "https://github.com/PhpGt/Daemon/tree/v1.1.4" + "issues": "https://github.com/phpgt/Daemon/issues", + "source": "https://github.com/phpgt/Daemon/tree/v1.1.5" }, "funding": [ { @@ -109,7 +109,7 @@ "type": "github" } ], - "time": "2024-05-16T08:42:54+00:00" + "time": "2026-03-11T14:11:10+00:00" } ], "packages-dev": [ @@ -406,11 +406,11 @@ }, { "name": "phpstan/phpstan", - "version": "2.1.40", + "version": "2.1.46", "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/9b2c7aeb83a75d8680ea5e7c9b7fca88052b766b", - "reference": "9b2c7aeb83a75d8680ea5e7c9b7fca88052b766b", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/a193923fc2d6325ef4e741cf3af8c3e8f54dbf25", + "reference": "a193923fc2d6325ef4e741cf3af8c3e8f54dbf25", "shasum": "" }, "require": { @@ -455,7 +455,7 @@ "type": "github" } ], - "time": "2026-02-23T15:04:35+00:00" + "time": "2026-04-01T09:25:14+00:00" }, { "name": "psr/container", @@ -641,16 +641,16 @@ }, { "name": "symfony/config", - "version": "v7.4.7", + "version": "v7.4.8", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "6c17162555bfb58957a55bb0e43e00035b6ae3d5" + "reference": "2d19dde43fa2ff720b9a40763ace7226594f503b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/6c17162555bfb58957a55bb0e43e00035b6ae3d5", - "reference": "6c17162555bfb58957a55bb0e43e00035b6ae3d5", + "url": "https://api.github.com/repos/symfony/config/zipball/2d19dde43fa2ff720b9a40763ace7226594f503b", + "reference": "2d19dde43fa2ff720b9a40763ace7226594f503b", "shasum": "" }, "require": { @@ -696,7 +696,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v7.4.7" + "source": "https://github.com/symfony/config/tree/v7.4.8" }, "funding": [ { @@ -716,20 +716,20 @@ "type": "tidelift" } ], - "time": "2026-03-06T10:41:14+00:00" + "time": "2026-03-24T13:12:05+00:00" }, { "name": "symfony/dependency-injection", - "version": "v7.4.7", + "version": "v7.4.8", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "0f651e58f4917fb0e2cd261ccbfe3d71e6e0f5db" + "reference": "f7025fd7b687c240426562f86ada06a93b1e771d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/0f651e58f4917fb0e2cd261ccbfe3d71e6e0f5db", - "reference": "0f651e58f4917fb0e2cd261ccbfe3d71e6e0f5db", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/f7025fd7b687c240426562f86ada06a93b1e771d", + "reference": "f7025fd7b687c240426562f86ada06a93b1e771d", "shasum": "" }, "require": { @@ -780,7 +780,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v7.4.7" + "source": "https://github.com/symfony/dependency-injection/tree/v7.4.8" }, "funding": [ { @@ -800,7 +800,7 @@ "type": "tidelift" } ], - "time": "2026-03-03T07:48:48+00:00" + "time": "2026-03-31T06:50:29+00:00" }, { "name": "symfony/deprecation-contracts", @@ -871,16 +871,16 @@ }, { "name": "symfony/filesystem", - "version": "v7.4.6", + "version": "v7.4.8", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "3ebc794fa5315e59fd122561623c2e2e4280538e" + "reference": "58b9790d12f9670b7f53a1c1738febd3108970a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/3ebc794fa5315e59fd122561623c2e2e4280538e", - "reference": "3ebc794fa5315e59fd122561623c2e2e4280538e", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/58b9790d12f9670b7f53a1c1738febd3108970a5", + "reference": "58b9790d12f9670b7f53a1c1738febd3108970a5", "shasum": "" }, "require": { @@ -917,7 +917,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v7.4.6" + "source": "https://github.com/symfony/filesystem/tree/v7.4.8" }, "funding": [ { @@ -937,7 +937,7 @@ "type": "tidelift" } ], - "time": "2026-02-25T16:50:00+00:00" + "time": "2026-03-24T13:12:05+00:00" }, { "name": "symfony/polyfill-ctype", @@ -1196,25 +1196,26 @@ }, { "name": "symfony/var-exporter", - "version": "v8.0.0", + "version": "v7.4.8", "source": { "type": "git", "url": "https://github.com/symfony/var-exporter.git", - "reference": "7345f46c251f2eb27c7b3ebdb5bb076b3ffcae04" + "reference": "398907e89a2a56fe426f7955c6fa943ec0c77225" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/7345f46c251f2eb27c7b3ebdb5bb076b3ffcae04", - "reference": "7345f46c251f2eb27c7b3ebdb5bb076b3ffcae04", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/398907e89a2a56fe426f7955c6fa943ec0c77225", + "reference": "398907e89a2a56fe426f7955c6fa943ec0c77225", "shasum": "" }, "require": { - "php": ">=8.4" + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3" }, "require-dev": { - "symfony/property-access": "^7.4|^8.0", - "symfony/serializer": "^7.4|^8.0", - "symfony/var-dumper": "^7.4|^8.0" + "symfony/property-access": "^6.4|^7.0|^8.0", + "symfony/serializer": "^6.4|^7.0|^8.0", + "symfony/var-dumper": "^6.4|^7.0|^8.0" }, "type": "library", "autoload": { @@ -1252,7 +1253,7 @@ "serialize" ], "support": { - "source": "https://github.com/symfony/var-exporter/tree/v8.0.0" + "source": "https://github.com/symfony/var-exporter/tree/v7.4.8" }, "funding": [ { @@ -1272,7 +1273,7 @@ "type": "tidelift" } ], - "time": "2025-11-05T18:53:00+00:00" + "time": "2026-03-24T13:12:05+00:00" } ], "aliases": [], @@ -1281,7 +1282,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=8.0" + "php": ">=8.2" }, "platform-dev": {}, "plugin-api-version": "2.9.0" diff --git a/src/Cli/StartCommand.php b/src/Cli/StartCommand.php index b3c6d08..554c41c 100644 --- a/src/Cli/StartCommand.php +++ b/src/Cli/StartCommand.php @@ -18,7 +18,7 @@ class StartCommand extends Command { private bool $log404ToErrorLog = true; // phpcs:disable Generic.Metrics.CyclomaticComplexity - public function run(?ArgumentValueList $arguments = null):void { + public function run(?ArgumentValueList $arguments = null):int { $goPath = implode(DIRECTORY_SEPARATOR, [ "vendor", "phpgt", @@ -30,7 +30,7 @@ public function run(?ArgumentValueList $arguments = null):void { "Error: Current directory is not a WebEngine project", Stream::ERROR ); - return; + return 1; } $this->loadLoggerOutputConfig(); @@ -80,6 +80,8 @@ public function run(?ArgumentValueList $arguments = null):void { usleep(250000); // 1/4 second } while($process->isRunning()); + + return 2; } public function getName():string { From 7f2b23d68195b117de79f57ff4872e8e7ebb2e94 Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Tue, 7 Apr 2026 22:58:56 +0100 Subject: [PATCH 2/3] tweak: remove unused test --- phpcs.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/phpcs.xml b/phpcs.xml index b771656..ad96b86 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -25,7 +25,6 @@ - From 50e038f687795164685dc560be166936af2b1b22 Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Tue, 7 Apr 2026 23:00:45 +0100 Subject: [PATCH 3/3] tidy: satisfy static analysis --- phpmd.xml | 2 +- src/Cli/StartCommand.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/phpmd.xml b/phpmd.xml index 5424e30..c5a9ecc 100644 --- a/phpmd.xml +++ b/phpmd.xml @@ -33,7 +33,7 @@ - + diff --git a/src/Cli/StartCommand.php b/src/Cli/StartCommand.php index 554c41c..0dd9d7e 100644 --- a/src/Cli/StartCommand.php +++ b/src/Cli/StartCommand.php @@ -152,6 +152,10 @@ private function buildCommand( return $cmd; } + /** + * @SuppressWarnings("PHPMD.CyclomaticComplexity") + * @SuppressWarnings("PHPMD.NPathComplexity") + */ private function filterErrorOutput(string $errorOutput):string { if($errorOutput === "") { return "";