From 5c596d2d1b79dac1b4a1b8c1e4f7b5eec1aad8cc Mon Sep 17 00:00:00 2001 From: Reedy Date: Wed, 2 Nov 2022 15:15:29 -0600 Subject: [PATCH] Namespace Special Change-Id: If194554d8af60369699b057af5b4a2e5dab4897e --- extension.json | 10 +++------- includes/Formatters/SpecialNotificationsFormatter.php | 2 +- includes/{special => Special}/NotificationPager.php | 9 +++++++++ .../SpecialDisplayNotificationsConfiguration.php | 7 +++++++ includes/{special => Special}/SpecialNotifications.php | 8 ++++++++ .../SpecialNotificationsMarkRead.php | 10 ++++++++-- 6 files changed, 36 insertions(+), 10 deletions(-) rename includes/{special => Special}/NotificationPager.php (91%) rename includes/{special => Special}/SpecialDisplayNotificationsConfiguration.php (98%) rename includes/{special => Special}/SpecialNotifications.php (97%) rename includes/{special => Special}/SpecialNotificationsMarkRead.php (95%) diff --git a/extension.json b/extension.json index 7542e1813..c5aead20c 100644 --- a/extension.json +++ b/extension.json @@ -52,15 +52,15 @@ "EchoPushNotificationRequest": "MediaWiki\\Extension\\Notifications\\Push\\NotificationRequestJob" }, "SpecialPages": { - "Notifications": "SpecialNotifications", + "Notifications": "MediaWiki\\Extension\\Notifications\\Special\\SpecialNotifications", "DisplayNotificationsConfiguration": { - "class": "SpecialDisplayNotificationsConfiguration", + "class": "MediaWiki\\Extension\\Notifications\\Special\\SpecialDisplayNotificationsConfiguration", "services": [ "EchoAttributeManager", "UserOptionsManager" ] }, - "NotificationsMarkRead": "SpecialNotificationsMarkRead" + "NotificationsMarkRead": "MediaWiki\\Extension\\Notifications\\Special\\SpecialNotificationsMarkRead" }, "AvailableRights": [ "manage-all-push-subscriptions" @@ -1117,15 +1117,11 @@ "MWEchoEmailBatch": "includes/EmailBatch.php", "MWEchoEventLogging": "includes/EventLogging.php", "MWEchoNotifUser": "includes/NotifUser.php", - "NotificationPager": "includes/special/NotificationPager.php", "ProcessEchoEmailBatch": "maintenance/processEchoEmailBatch.php", "RecomputeNotifCounts": "maintenance/recomputeNotifCounts.php", "RemoveInvalidNotification": "maintenance/removeInvalidNotification.php", "RemoveOrphanedEvents": "maintenance/removeOrphanedEvents.php", "ResourceLoaderEchoImageModule": "includes/ResourceLoaderEchoImageModule.php", - "SpecialDisplayNotificationsConfiguration": "includes/special/SpecialDisplayNotificationsConfiguration.php", - "SpecialNotifications": "includes/special/SpecialNotifications.php", - "SpecialNotificationsMarkRead": "includes/special/SpecialNotificationsMarkRead.php", "UpdateEchoSchemaForSuppression": "maintenance/updateEchoSchemaForSuppression.php", "EchoUpdatePerUserBlacklist": "maintenance/updatePerUserBlacklist.php", "EchoPush\\PushNotifier": "includes/Push/PushNotifier.php", diff --git a/includes/Formatters/SpecialNotificationsFormatter.php b/includes/Formatters/SpecialNotificationsFormatter.php index e20130ea5..77c80be75 100644 --- a/includes/Formatters/SpecialNotificationsFormatter.php +++ b/includes/Formatters/SpecialNotificationsFormatter.php @@ -3,10 +3,10 @@ namespace MediaWiki\Extension\Notifications\Formatters; use Html; +use MediaWiki\Extension\Notifications\Special\SpecialNotificationsMarkRead; use MWTimestamp; use OOUI\IconWidget; use OutputPage; -use SpecialNotificationsMarkRead; use Xml; /** diff --git a/includes/special/NotificationPager.php b/includes/Special/NotificationPager.php similarity index 91% rename from includes/special/NotificationPager.php rename to includes/Special/NotificationPager.php index cfa4b75fc..67ff83dba 100644 --- a/includes/special/NotificationPager.php +++ b/includes/Special/NotificationPager.php @@ -1,5 +1,14 @@ $this->par, 'filter-callback' => static function ( $value, $alldata ) { // Allow for a single value or a set of values - $result = explode( ',', $value ); - return $result; + return explode( ',', $value ); }, 'validation-callback' => function ( $value, $alldata ) { if ( $value === [ 'ALL' ] ) {