Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
57 changes: 31 additions & 26 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions src/Cli/RunCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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")) {
Expand Down Expand Up @@ -69,6 +69,8 @@ public function run(?ArgumentValueList $arguments = null):void {
Stream::ERROR
);
}

return 0;
}

/**
Expand Down
Loading