100% analysis in Psalm
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@ -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'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user