summaryrefslogtreecommitdiff
path: root/update_daemon2.php
diff options
context:
space:
mode:
authorwn_ <[email protected]>2021-11-10 21:38:25 +0000
committerwn_ <[email protected]>2021-11-10 21:38:25 +0000
commit4cc3374f9f6cdd6ea05d4d16942d0165d8b2ed90 (patch)
tree00f0ff6ba464d3b7741b9f0bb36c306d329d6836 /update_daemon2.php
parent87a30d88d36941ad817f0d1409e2ededbe576af6 (diff)
Initial go at PHPStan rule level 6.
Diffstat (limited to 'update_daemon2.php')
-rwxr-xr-xupdate_daemon2.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/update_daemon2.php b/update_daemon2.php
index 8931813ff..46f7450a6 100755
--- a/update_daemon2.php
+++ b/update_daemon2.php
@@ -37,7 +37,7 @@
/**
* @SuppressWarnings(unused)
*/
- function reap_children() {
+ function reap_children(): int {
global $children;
global $ctimes;
@@ -64,7 +64,7 @@
return count($tmp);
}
- function check_ctimes() {
+ function check_ctimes(): void {
global $ctimes;
foreach (array_keys($ctimes) as $pid) {
@@ -80,7 +80,7 @@
/**
* @SuppressWarnings(unused)
*/
- function sigchld_handler($signal) {
+ function sigchld_handler(int $signo, mixed $siginfo): void {
$running_jobs = reap_children();
Debug::log("Received SIGCHLD, $running_jobs active tasks left.");
@@ -88,7 +88,7 @@
pcntl_waitpid(-1, $status, WNOHANG);
}
- function shutdown($caller_pid) {
+ function shutdown(int $caller_pid): void {
if ($caller_pid == posix_getpid()) {
if (file_exists(Config::get(Config::LOCK_DIRECTORY) . "/update_daemon.lock")) {
Debug::log("Removing lockfile (master)...");
@@ -97,7 +97,7 @@
}
}
- function task_shutdown() {
+ function task_shutdown(): void {
$pid = posix_getpid();
if (file_exists(Config::get(Config::LOCK_DIRECTORY) . "/update_daemon-$pid.lock")) {
@@ -106,13 +106,13 @@
}
}
- function sigint_handler() {
+ function sigint_handler(): void {
Debug::log("[MASTER] SIG_INT received, shutting down master process.");
shutdown(posix_getpid());
die;
}
- function task_sigint_handler() {
+ function task_sigint_handler(): void {
Debug::log("[TASK] SIG_INT received, shutting down task.");
task_shutdown();
die;