aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-03-04 12:03:09 +0100
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2024-03-07 22:40:30 +0100
commit31d24a5538e7773b862a7ffe6ad7abb0002979b1 (patch)
treee37bafe1a7a80230d969683fc619671311b7727b
parent9c1a87aec4bcfa5069e7a762b2efd324cefc1810 (diff)
downloadnextcloud-server-31d24a5538e7773b862a7ffe6ad7abb0002979b1.tar.gz
nextcloud-server-31d24a5538e7773b862a7ffe6ad7abb0002979b1.zip
fix(updatenotification): Resolve static code analysis errors
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
-rw-r--r--apps/updatenotification/lib/BackgroundJob/ResetToken.php2
-rw-r--r--apps/updatenotification/lib/BackgroundJob/UpdateAvailableNotifications.php8
-rw-r--r--apps/updatenotification/lib/Notification/Notifier.php15
3 files changed, 11 insertions, 14 deletions
diff --git a/apps/updatenotification/lib/BackgroundJob/ResetToken.php b/apps/updatenotification/lib/BackgroundJob/ResetToken.php
index 856e179814b..05f8ea639a8 100644
--- a/apps/updatenotification/lib/BackgroundJob/ResetToken.php
+++ b/apps/updatenotification/lib/BackgroundJob/ResetToken.php
@@ -55,7 +55,7 @@ class ResetToken extends TimedJob {
* @param $argument
*/
protected function run($argument) {
- if ($this->config->getSystemValueBool('config_is_read_only') !== false) {
+ if ($this->config->getSystemValueBool('config_is_read_only')) {
return;
}
diff --git a/apps/updatenotification/lib/BackgroundJob/UpdateAvailableNotifications.php b/apps/updatenotification/lib/BackgroundJob/UpdateAvailableNotifications.php
index 6afe1ec5e37..6e7cc7928ab 100644
--- a/apps/updatenotification/lib/BackgroundJob/UpdateAvailableNotifications.php
+++ b/apps/updatenotification/lib/BackgroundJob/UpdateAvailableNotifications.php
@@ -171,7 +171,7 @@ class UpdateAvailableNotifications extends TimedJob {
return;
}
- if ($lastNotification !== false) {
+ if ($lastNotification !== '') {
// Delete old updates
$this->deleteOutdatedNotifications($app, $lastNotification);
}
@@ -213,14 +213,12 @@ class UpdateAvailableNotifications extends TimedJob {
$groupToNotify = $this->groupManager->get($group);
if ($groupToNotify instanceof IGroup) {
foreach ($groupToNotify->getUsers() as $user) {
- $this->users[$user->getUID()] = true;
+ $this->users[] = $user->getUID();
}
}
}
- $this->users = array_keys($this->users);
-
- return $this->users;
+ return array_unique($this->users);
}
/**
diff --git a/apps/updatenotification/lib/Notification/Notifier.php b/apps/updatenotification/lib/Notification/Notifier.php
index 0aace555092..e53ae542607 100644
--- a/apps/updatenotification/lib/Notification/Notifier.php
+++ b/apps/updatenotification/lib/Notification/Notifier.php
@@ -133,14 +133,13 @@ class Notifier implements INotifier {
$this->updateAlreadyInstalledCheck($notification, $this->getCoreVersions());
$parameters = $notification->getSubjectParameters();
- $notification->setParsedSubject($l->t('Update to %1$s is available.', [$parameters['version']]))
- ->setRichSubject($l->t('Update to {serverAndVersion} is available.'), [
- 'serverAndVersion' => [
- 'type' => 'highlight',
- 'id' => $notification->getObjectType(),
- 'name' => $parameters['version'],
- ]
- ]);
+ $notification->setRichSubject($l->t('Update to {serverAndVersion} is available.'), [
+ 'serverAndVersion' => [
+ 'type' => 'highlight',
+ 'id' => $notification->getObjectType(),
+ 'name' => $parameters['version'],
+ ]
+ ]);
if ($this->isAdmin()) {
$notification->setLink($this->url->linkToRouteAbsolute('settings.AdminSettings.index', ['section' => 'overview']) . '#version');