Type for Closure argument

Signed-off-by: Pablo Zmdl <pablo@nextcloud.com>
This commit is contained in:
Pablo Zmdl 2026-01-20 19:34:52 +01:00
parent 662840bc25
commit 77bec5898f
2 changed files with 8 additions and 8 deletions

View file

@ -123,7 +123,7 @@ readonly class DockerController {
} }
public function StartBackupContainerRestore(Request $request, Response $response, array $args) : Response { public function StartBackupContainerRestore(Request $request, Response $response, array $args) : Response {
$this->configurationManager->setMultiple(function ($confManager) use ($request) { $this->configurationManager->setMultiple(function (ConfigurationManager $confManager) use ($request) {
$confManager->backupMode = 'restore'; $confManager->backupMode = 'restore';
$confManager->selectedRestoreTime = $request->getParsedBody()['selected_restore_time'] ?? ''; $confManager->selectedRestoreTime = $request->getParsedBody()['selected_restore_time'] ?? '';
$confManager->restoreExcludePreviews = isset($request->getParsedBody()['restore-exclude-previews']); $confManager->restoreExcludePreviews = isset($request->getParsedBody()['restore-exclude-previews']);
@ -152,7 +152,7 @@ readonly class DockerController {
} }
public function StartBackupContainerTest(Request $request, Response $response, array $args) : Response { public function StartBackupContainerTest(Request $request, Response $response, array $args) : Response {
$this->configurationManager->setMultiple(function ($confManager) { $this->configurationManager->setMultiple(function (ConfigurationManager $confManager) {
$confManager->backupMode = 'test'; $confManager->backupMode = 'test';
$confManager->instance_restore_attempt = false; $confManager->instance_restore_attempt = false;
}); });
@ -177,7 +177,7 @@ readonly class DockerController {
$port = 443; $port = 443;
} }
$this->configurationManager->setMultiple(function ($confManager) use ($request, $host, $port, $path) { $this->configurationManager->setMultiple(function (ConfigurationManager $confManager) use ($request, $host, $port, $path) {
$confManager->install_latest_major = isset($request->getParsedBody()['install_latest_major']); $confManager->install_latest_major = isset($request->getParsedBody()['install_latest_major']);
// set AIO_URL // set AIO_URL
$confManager->AIO_URL = $host . ':' . (string)$port . $path; $confManager->AIO_URL = $host . ':' . (string)$port . $path;

View file

@ -419,7 +419,7 @@ class ConfigurationManager
} }
} }
$this->setMultiple(function ($confManager) use ($domain) { $this->setMultiple(function (ConfigurationManager $confManager) use ($domain) {
// Write domain // Write domain
// Don't set the domain via the attribute, or we create a loop. // Don't set the domain via the attribute, or we create a loop.
$confManager->set('domain', $domain); $confManager->set('domain', $domain);
@ -441,7 +441,7 @@ class ConfigurationManager
*/ */
public function SetBorgLocationVars(string $location, string $repo) : void { public function SetBorgLocationVars(string $location, string $repo) : void {
$this->ValidateBorgLocationVars($location, $repo); $this->ValidateBorgLocationVars($location, $repo);
$this->setMultiple(function ($confManager) use ($location, $repo) { $this->setMultiple(function (ConfigurationManager $confManager) use ($location, $repo) {
$confManager->borg_backup_host_location = $location; $confManager->borg_backup_host_location = $location;
$confManager->borg_remote_repo = $repo; $confManager->borg_remote_repo = $repo;
}); });
@ -490,7 +490,7 @@ class ConfigurationManager
public function DeleteBorgBackupLocationItems() : void { public function DeleteBorgBackupLocationItems() : void {
// Delete the variables // Delete the variables
$this->setMultiple(function ($confManager) { $this->setMultiple(function (ConfigurationManager $confManager) {
$confManager->borg_backup_host_location = ''; $confManager->borg_backup_host_location = '';
$confManager->borg_remote_repo = ''; $confManager->borg_remote_repo = '';
}); });
@ -513,7 +513,7 @@ class ConfigurationManager
throw new InvalidSettingConfigurationException("Please enter the password!"); throw new InvalidSettingConfigurationException("Please enter the password!");
} }
$this->setMultiple(function ($confManager) use ($location, $repo, $password) { $this->setMultiple(function (ConfigurationManager $confManager) use ($location, $repo, $password) {
$confManager->borg_backup_host_location = $location; $confManager->borg_backup_host_location = $location;
$confManager->borg_remote_repo = $repo; $confManager->borg_remote_repo = $repo;
$confManager->borg_restore_password = $password; $confManager->borg_restore_password = $password;
@ -976,7 +976,7 @@ class ConfigurationManager
if ($input === []) { if ($input === []) {
return; return;
} }
$this->setMultiple(function($confManager) use ($input) { $this->setMultiple(function(ConfigurationManager $confManager) use ($input) {
foreach ($input as $variable) { foreach ($input as $variable) {
$keyWithValue = $confManager->replaceEnvPlaceholders($variable); $keyWithValue = $confManager->replaceEnvPlaceholders($variable);
[$key, $value] = explode('=', $keyWithValue, 2); [$key, $value] = explode('=', $keyWithValue, 2);