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