diff --git a/composer.json b/composer.json index 091090d..13b2cb2 100644 --- a/composer.json +++ b/composer.json @@ -3,8 +3,8 @@ "description": "Run scripts or static functions at regular intervals.", "require": { - "php": ">=8.1", - "phpgt/cli": "1.*", + "php": ">=8.2", + "phpgt/cli": "^1.4", "phpgt/config": "^1.1", "phpgt/input": "^1.3", "phpgt/servicecontainer": "^1.3" diff --git a/composer.lock b/composer.lock index 3b032b7..f718680 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": "670afda6ca286c30ee9530dd3fe7fe8e", + "content-hash": "3f70ee3a35fc695c358a5576a2ba37fe", "packages": [ { "name": "magicalex/write-ini-file", @@ -107,27 +107,29 @@ }, { "name": "phpgt/cli", - "version": "v1.3.4", + "version": "v1.4.0", "source": { "type": "git", - "url": "https://github.com/PhpGt/Cli.git", - "reference": "71deb9cdc5a3ea8bfb665faa29739badbf61e9da" + "url": "https://github.com/phpgt/Cli.git", + "reference": "84a1b720efe836624313061ac42e81dd7d9c2948" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PhpGt/Cli/zipball/71deb9cdc5a3ea8bfb665faa29739badbf61e9da", - "reference": "71deb9cdc5a3ea8bfb665faa29739badbf61e9da", + "url": "https://api.github.com/repos/phpgt/Cli/zipball/84a1b720efe836624313061ac42e81dd7d9c2948", + "reference": "84a1b720efe836624313061ac42e81dd7d9c2948", "shasum": "" }, "require": { "ext-json": "*", "ext-readline": "*", - "php": ">=8.0", - "phpgt/daemon": "^v1.1" + "php": ">=8.2", + "phpgt/daemon": "^1.1.3" }, "require-dev": { - "phpstan/phpstan": "^v1.8", - "phpunit/phpunit": "^v9.5" + "phpmd/phpmd": "^2.13", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^10.5", + "squizlabs/php_codesniffer": "^3.7" }, "type": "library", "autoload": { @@ -153,8 +155,8 @@ "webengine" ], "support": { - "issues": "https://github.com/PhpGt/Cli/issues", - "source": "https://github.com/PhpGt/Cli/tree/v1.3.4" + "issues": "https://github.com/phpgt/Cli/issues", + "source": "https://github.com/phpgt/Cli/tree/v1.4.0" }, "funding": [ { @@ -162,7 +164,7 @@ "type": "github" } ], - "time": "2023-09-18T10:06:17+00:00" + "time": "2026-03-08T23:28:56+00:00" }, { "name": "phpgt/config", @@ -282,24 +284,27 @@ }, { "name": "phpgt/daemon", - "version": "v1.1.2", + "version": "v1.1.5", "source": { "type": "git", - "url": "https://github.com/PhpGt/Daemon.git", - "reference": "6490df99a22818149f30e3af408002ea7f73e035" + "url": "https://github.com/phpgt/Daemon.git", + "reference": "413e16b54de6e1fd5c2b646b485f88a86dfedd9a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PhpGt/Daemon/zipball/6490df99a22818149f30e3af408002ea7f73e035", - "reference": "6490df99a22818149f30e3af408002ea7f73e035", + "url": "https://api.github.com/repos/phpgt/Daemon/zipball/413e16b54de6e1fd5c2b646b485f88a86dfedd9a", + "reference": "413e16b54de6e1fd5c2b646b485f88a86dfedd9a", "shasum": "" }, "require": { - "php": ">=7.4" + "ext-pcntl": "*", + "php": ">=8.1" }, "require-dev": { - "phpstan/phpstan": ">=0.12.42", - "phpunit/phpunit": "9.*" + "phpmd/phpmd": "^2.13", + "phpstan/phpstan": "^v1.10", + "phpunit/phpunit": "^10.5", + "squizlabs/php_codesniffer": "^3.7" }, "type": "library", "autoload": { @@ -310,16 +315,16 @@ "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.2" + "issues": "https://github.com/phpgt/Daemon/issues", + "source": "https://github.com/phpgt/Daemon/tree/v1.1.5" }, "funding": [ { - "url": "https://github.com/phpgt", + "url": "https://github.com/sponsors/PhpGt", "type": "github" } ], - "time": "2021-02-02T17:33:16+00:00" + "time": "2026-03-11T14:11:10+00:00" }, { "name": "phpgt/dataobject", @@ -3701,7 +3706,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=8.1" + "php": ">=8.2" }, "platform-dev": {}, "plugin-api-version": "2.9.0" diff --git a/src/Cli/RunCommand.php b/src/Cli/RunCommand.php index 39e3f1c..7177c99 100644 --- a/src/Cli/RunCommand.php +++ b/src/Cli/RunCommand.php @@ -15,7 +15,7 @@ class RunCommand extends Command { /** @SuppressWarnings(PHPMD.ExitExpression) */ - public function run(?ArgumentValueList $arguments = null):void { + public function run(?ArgumentValueList $arguments = null):int { $filename = $arguments->get("file", "crontab"); $filePath = implode(DIRECTORY_SEPARATOR, [ getcwd(), @@ -30,14 +30,14 @@ public function run(?ArgumentValueList $arguments = null):void { } catch(CrontabNotFoundException) { $this->stream->writeLine("Skipping cron as there is no crontab file."); - return; + return 1; } catch(CronException $exception) { $this->stream->writeLine( $exception->getMessage(), Stream::ERROR ); - return; + return 2; } if($arguments->contains("validate")) { @@ -69,6 +69,8 @@ public function run(?ArgumentValueList $arguments = null):void { Stream::ERROR ); } + + return 0; } /**