Fix 10 PHPStan errors
This commit is contained in:
parent
e1eb6fff83
commit
7e66b35b46
4 changed files with 10 additions and 11 deletions
|
@ -80,7 +80,7 @@ class Database implements ICanWriteToStorage
|
|||
throw new StorageException(sprintf('Database storage failed to update %s', $reference), 500, new Exception($this->dba->errorMessage(), $this->dba->errorNo()));
|
||||
}
|
||||
|
||||
return $this->dba->lastInsertId();
|
||||
return (string) $this->dba->lastInsertId();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -452,19 +452,17 @@ class System
|
|||
|
||||
/**
|
||||
* Returns the current Load of the System
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public static function currentLoad()
|
||||
public static function currentLoad(): float
|
||||
{
|
||||
if (!function_exists('sys_getloadavg')) {
|
||||
return false;
|
||||
return (float) 0;
|
||||
}
|
||||
|
||||
$load_arr = sys_getloadavg();
|
||||
|
||||
if (!is_array($load_arr)) {
|
||||
return false;
|
||||
return (float) 0;
|
||||
}
|
||||
|
||||
return round(max($load_arr[0], $load_arr[1]), 2);
|
||||
|
|
|
@ -217,7 +217,7 @@ class Update
|
|||
->set('system', 'maintenance', false)
|
||||
->delete('system', 'maintenance_reason')
|
||||
->commit();
|
||||
return $r;
|
||||
return 'Pre update failed';
|
||||
} else {
|
||||
DI::logger()->notice('Pre update executed.', ['version' => $version]);
|
||||
}
|
||||
|
@ -262,7 +262,7 @@ class Update
|
|||
->set('system', 'maintenance', false)
|
||||
->delete('system', 'maintenance_reason')
|
||||
->commit();
|
||||
return $r;
|
||||
return 'Post update failed';
|
||||
} else {
|
||||
DI::config()->set('system', 'build', $version);
|
||||
DI::logger()->notice('Post update executed.', ['version' => $version]);
|
||||
|
|
|
@ -271,12 +271,13 @@ class Worker
|
|||
*
|
||||
* @param integer $priority The priority that should be checked
|
||||
*
|
||||
* @return integer Is there a process running with that priority?
|
||||
* @return bool Is there a process running with that priority?
|
||||
* @throws \Exception
|
||||
*/
|
||||
private static function processWithPriorityActive(int $priority): int
|
||||
private static function processWithPriorityActive(int $priority): bool
|
||||
{
|
||||
$condition = ["`priority` <= ? AND `pid` != 0 AND NOT `done`", $priority];
|
||||
|
||||
return DBA::exists('workerqueue', $condition);
|
||||
}
|
||||
|
||||
|
@ -955,7 +956,7 @@ class Worker
|
|||
/**
|
||||
* Returns the priority of the next workerqueue job
|
||||
*
|
||||
* @return string|bool priority or FALSE on failure
|
||||
* @return int|false priority or FALSE on failure
|
||||
* @throws \Exception
|
||||
*/
|
||||
private static function nextPriority()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue