diff --git a/judge/judgedaemon.main.php b/judge/judgedaemon.main.php index 2953e8a781..9ac1bf37c0 100644 --- a/judge/judgedaemon.main.php +++ b/judge/judgedaemon.main.php @@ -857,7 +857,7 @@ private function readJudgehostLog(int $numLines = 20): string return trim(ob_get_clean()); } - private function runCommandSafe(array $command_parts, & $retval = DONT_CARE, $log_nonzero_exitcode = true): bool + private function runCommandSafe(array $command_parts, &$retval = DONT_CARE, $log_nonzero_exitcode = true): bool { if (empty($command_parts)) { logmsg(LOG_WARNING, "Need at least the command that should be called."); @@ -869,7 +869,7 @@ private function runCommandSafe(array $command_parts, & $retval = DONT_CARE, $lo logmsg(LOG_DEBUG, "Executing command: $command"); system($command, $retval_local); - if ($retval !== DONT_CARE) $retval = $retval_local; + if ($retval !== DONT_CARE) $retval = $retval_local; // phpcs:ignore Generic.ControlStructures.InlineControlStructure.NotAllowed if ($retval_local !== 0) { if ($log_nonzero_exitcode) { @@ -888,8 +888,7 @@ private function fetchExecutable( string $hash, int $judgeTaskId, bool $combined_run_compare = false - ): array - { + ): array { [$execrunpath, $error, $buildlogpath] = $this->fetchExecutableInternal($workdirpath, $type, $execid, $hash, $combined_run_compare); if (isset($error)) { $extra_log = null; @@ -917,8 +916,7 @@ private function fetchExecutableInternal( string $execid, string $hash, bool $combined_run_compare = false - ): array - { + ): array { $execdir = join('/', [ $workdirpath, 'executable', @@ -1123,12 +1121,11 @@ private function registerJudgehost(): void private function disable( string $kind, string $idcolumn, - $id, + mixed $id, string $description, ?int $judgeTaskId = null, ?string $extra_log = null - ): void - { + ): void { $disabled = dj_json_encode(['kind' => $kind, $idcolumn => $id]); $judgehostlog = $this->readJudgehostLog(); if (isset($extra_log)) { @@ -1197,8 +1194,7 @@ private function compile( array $compile_config, ?string $daemonid, int $output_storage_limit - ): bool - { + ): bool { // Reuse compilation if it already exists. if (file_exists("$workdir/compile.success")) { return true;