refactor(updatenotification): use constant instead of variable

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
pull/52669/head
Ferdinand Thiessen 2025-05-06 19:41:56 +07:00
parent 6e9b4eb0a8
commit be3cf85656
No known key found for this signature in database
GPG Key ID: 45FAE7268762B400
1 changed files with 9 additions and 4 deletions

@ -22,10 +22,15 @@ use OCP\Notification\IManager;
use OCP\ServerVersion;
class UpdateAvailableNotifications extends TimedJob {
protected $connectionNotifications = [3, 7, 14, 30];
/** @var string[] */
protected $users;
/**
* Numbers of failed updater connection to report error as notification.
* @var list<int>
*/
protected const CONNECTION_NOTIFICATIONS = [3, 7, 14, 30];
/** @var ?string[] */
protected $users = null;
public function __construct(
ITimeFactory $timeFactory,
@ -83,7 +88,7 @@ class UpdateAvailableNotifications extends TimedJob {
$errors = 1 + $this->appConfig->getAppValueInt('update_check_errors', 0);
$this->appConfig->setAppValueInt('update_check_errors', $errors);
if (\in_array($errors, $this->connectionNotifications, true)) {
if (\in_array($errors, self::CONNECTION_NOTIFICATIONS, true)) {
$this->sendErrorNotifications($errors);
}
} elseif (\is_array($status)) {