mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
refactor(updatenotification): use constant instead of variable
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
6e9b4eb0a8
commit
be3cf85656
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)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue