100% analysis in Psalm
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Jens True 2023-07-05 15:00:31 +00:00
parent c1fb42c4ff
commit 50ae396000
2 changed files with 13 additions and 4 deletions

@ -44,12 +44,18 @@ class CommandBackup extends Command
$rclone->setLogger($app->getLogger()->withName('rclone'));
$notification = new Notification();
$notification->loadMany($app->getConfig('notification'));
/** @var array<array-key,array<string,string>> */
$notificationConfig = $app->getConfig('notification');
$notification->loadMany($notificationConfig);
$render = new Twig($app->getConfig('templates'));
/** @var array<string,string> */
$templateConfig = $app->getConfig('templates');
$render = new Twig($templateConfig);
/** @var array{title: string, source: string, destination: string}[] */
$backupElements = $app->getConfig('backup');
/** @var array{title: string, source: string, destination: string} $conf */
foreach ($sio->progressIterate($app->getConfig('backup')) as $conf) {
foreach ($sio->progressIterate($backupElements) as $conf) {
$title = $conf['title'];
try {
$template = array();

@ -79,7 +79,10 @@ class Rclone
if (!$process->isSuccessful()) {
throw new Exception($process->getErrorOutput());
}
return (int)json_decode($process->getOutput())->bytes;
/** @var array{bytes: int} */
$output = json_decode($process->getOutput(), true);
return $output['bytes'];
}
/**