diff options
author | jld3103 <jld3103yt@gmail.com> | 2023-03-31 08:53:56 +0200 |
---|---|---|
committer | jld3103 <jld3103yt@gmail.com> | 2023-04-05 09:08:56 +0200 |
commit | d9f85220038b2421870a36f9b6a860d6444a988a (patch) | |
tree | 10b8cbdb0c0ded7947b50654a4e1d4a30390768a /apps/updatenotification | |
parent | 54140dd6bfda81276bd889a9a141d51e328100d1 (diff) | |
download | nextcloud-server-d9f85220038b2421870a36f9b6a860d6444a988a.tar.gz nextcloud-server-d9f85220038b2421870a36f9b6a860d6444a988a.zip |
Fix types for reading and writing config values
Signed-off-by: jld3103 <jld3103yt@gmail.com>
Diffstat (limited to 'apps/updatenotification')
4 files changed, 7 insertions, 7 deletions
diff --git a/apps/updatenotification/lib/Controller/AdminController.php b/apps/updatenotification/lib/Controller/AdminController.php index b13ba66efd5..74a3a86c7e1 100644 --- a/apps/updatenotification/lib/Controller/AdminController.php +++ b/apps/updatenotification/lib/Controller/AdminController.php @@ -85,7 +85,7 @@ class AdminController extends Controller { */ public function setChannel(string $channel): DataResponse { Util::setChannel($channel); - $this->config->setAppValue('core', 'lastupdatedat', 0); + $this->config->setAppValue('core', 'lastupdatedat', '0'); return new DataResponse(['status' => 'success', 'data' => ['message' => $this->l10n->t('Channel updated')]]); } @@ -99,7 +99,7 @@ class AdminController extends Controller { // Create a new job and store the creation date $this->jobList->add(ResetTokenBackgroundJob::class); - $this->config->setAppValue('core', 'updater.secret.created', $this->timeFactory->getTime()); + $this->config->setAppValue('core', 'updater.secret.created', (string)$this->timeFactory->getTime()); // Create a new token $newToken = $this->secureRandom->generate(64); diff --git a/apps/updatenotification/lib/Notification/BackgroundJob.php b/apps/updatenotification/lib/Notification/BackgroundJob.php index c1b3cddf945..f8f1f41e589 100644 --- a/apps/updatenotification/lib/Notification/BackgroundJob.php +++ b/apps/updatenotification/lib/Notification/BackgroundJob.php @@ -108,14 +108,14 @@ class BackgroundJob extends TimedJob { $status = $updater->check(); if ($status === false) { - $errors = 1 + (int) $this->config->getAppValue('updatenotification', 'update_check_errors', 0); - $this->config->setAppValue('updatenotification', 'update_check_errors', $errors); + $errors = 1 + (int) $this->config->getAppValue('updatenotification', 'update_check_errors', '0'); + $this->config->setAppValue('updatenotification', 'update_check_errors', (string)$errors); if (\in_array($errors, $this->connectionNotifications, true)) { $this->sendErrorNotifications($errors); } } elseif (\is_array($status)) { - $this->config->setAppValue('updatenotification', 'update_check_errors', 0); + $this->config->setAppValue('updatenotification', 'update_check_errors', '0'); $this->clearErrorNotifications(); if (isset($status['version'])) { diff --git a/apps/updatenotification/lib/Notification/Notifier.php b/apps/updatenotification/lib/Notification/Notifier.php index c1269daaa30..9ce233ed721 100644 --- a/apps/updatenotification/lib/Notification/Notifier.php +++ b/apps/updatenotification/lib/Notification/Notifier.php @@ -115,7 +115,7 @@ class Notifier implements INotifier { $l = $this->l10NFactory->get('updatenotification', $languageCode); if ($notification->getSubject() === 'connection_error') { - $errors = (int) $this->config->getAppValue('updatenotification', 'update_check_errors', 0); + $errors = (int) $this->config->getAppValue('updatenotification', 'update_check_errors', '0'); if ($errors === 0) { $this->notificationManager->markProcessed($notification); throw new \InvalidArgumentException('Update checked worked again'); diff --git a/apps/updatenotification/lib/Settings/Admin.php b/apps/updatenotification/lib/Settings/Admin.php index fded4451408..7f47a46f8f9 100644 --- a/apps/updatenotification/lib/Settings/Admin.php +++ b/apps/updatenotification/lib/Settings/Admin.php @@ -78,7 +78,7 @@ class Admin implements ISettings { } public function getForm(): TemplateResponse { - $lastUpdateCheckTimestamp = $this->config->getAppValue('core', 'lastupdatedat'); + $lastUpdateCheckTimestamp = (int)$this->config->getAppValue('core', 'lastupdatedat'); $lastUpdateCheck = $this->dateTimeFormatter->formatDateTime($lastUpdateCheckTimestamp); $channels = [ |