Browse Source

fix(updatenotification): Resolve static code analysis errors

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
tags/v29.0.0beta1
Ferdinand Thiessen 3 months ago
parent
commit
31d24a5538
No account linked to committer's email address

+ 1
- 1
apps/updatenotification/lib/BackgroundJob/ResetToken.php View File

@@ -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;
}


+ 3
- 5
apps/updatenotification/lib/BackgroundJob/UpdateAvailableNotifications.php View File

@@ -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);
}

/**

+ 7
- 8
apps/updatenotification/lib/Notification/Notifier.php View File

@@ -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');

Loading…
Cancel
Save