1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2026-01-08 14:09:15 +00:00

Initial go at PHPStan rule level 6.

This commit is contained in:
wn_
2021-11-10 21:38:25 +00:00
parent 87a30d88d3
commit 4cc3374f9f
12 changed files with 93 additions and 48 deletions

View File

@@ -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;