0
0
Fork 0
mirror of https://github.com/nextcloud/server.git synced 2025-05-03 13:30:32 +00:00
nextcloud_server/apps/files_reminders/lib/SetupChecks/NeedNotificationsApp.php
Ferdinand Thiessen 9dcbd76ced
chore: adjust syntax for app manager
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-04-07 11:58:29 +02:00

39 lines
997 B
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\FilesReminders\SetupChecks;
use OCP\App\IAppManager;
use OCP\IL10N;
use OCP\SetupCheck\ISetupCheck;
use OCP\SetupCheck\SetupResult;
class NeedNotificationsApp implements ISetupCheck {
public function __construct(
private IAppManager $appManager,
private IL10N $l10n,
) {
}
public function getName(): string {
return $this->l10n->t('Files reminder');
}
public function getCategory(): string {
return 'system';
}
public function run(): SetupResult {
if ($this->appManager->isInstalled('notifications')) {
return SetupResult::success($this->l10n->t('This files_reminder can work properly.'));
} else {
return SetupResult::warning($this->l10n->t('The files_reminder app needs the notification app to work properly. You should either enable notifications or disable files_reminder.'));
}
}
}