[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Improve some parameter docs
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/384222 ) Change subject: Improve some parameter docs .. Improve some parameter docs Change DB_SLAVE in comments Change-Id: Idd5787928b87f5af63864dc626cb603f281515d7 --- M includes/NotifUser.php M includes/controller/NotificationController.php M includes/mapper/AbstractMapper.php M includes/ooui/LabelIconWidget.php M phpcs.xml 5 files changed, 19 insertions(+), 21 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/includes/NotifUser.php b/includes/NotifUser.php index 129b97d..563ebfa 100644 --- a/includes/NotifUser.php +++ b/includes/NotifUser.php @@ -169,7 +169,7 @@ * Get message count for this user. * * @param bool $cached Set to false to bypass the cache. (Optional. Defaults to true) -* @param int $dbSource Use master or slave database to pull count (Optional. Defaults to DB_SLAVE) +* @param int $dbSource Use master or slave database to pull count (Optional. Defaults to DB_REPLICA) * @return int */ public function getMessageCount( $cached = true, $dbSource = DB_REPLICA ) { @@ -180,7 +180,7 @@ * Get alert count for this user. * * @param bool $cached Set to false to bypass the cache. (Optional. Defaults to true) -* @param int $dbSource Use master or slave database to pull count (Optional. Defaults to DB_SLAVE) +* @param int $dbSource Use master or slave database to pull count (Optional. Defaults to DB_REPLICA) * @return int */ public function getAlertCount( $cached = true, $dbSource = DB_REPLICA ) { @@ -198,7 +198,7 @@ * If $wgEchoCrossWikiNotifications is disabled, the $global parameter is ignored. * * @param bool $cached Set to false to bypass the cache. (Optional. Defaults to true) -* @param int $dbSource Use master or slave database to pull count (Optional. Defaults to DB_SLAVE) +* @param int $dbSource Use master or slave database to pull count (Optional. Defaults to DB_REPLICA) * @param string $section Notification section * @param bool|string $global Whether to include foreign notifications. If set to 'preference', uses the user's preference. * @return int @@ -247,7 +247,7 @@ * Get the timestamp of the latest unread alert * * @param bool $cached Set to false to bypass the cache. (Optional. Defaults to true) -* @param int $dbSource Use master or slave database to pull count (Optional. Defaults to DB_SLAVE) +* @param int $dbSource Use master or slave database to pull count (Optional. Defaults to DB_REPLICA) * @return bool|MWTimestamp Timestamp of latest unread alert, or false if there are no unread alerts. */ public function getLastUnreadAlertTime( $cached = true, $dbSource = DB_REPLICA ) { @@ -258,7 +258,7 @@ * Get the timestamp of the latest unread message * * @param bool $cached Set to false to bypass the cache. (Optional. Defaults to true) -* @param int $dbSource Use master or slave database to pull count (Optional. Defaults to DB_SLAVE) +* @param int $dbSource Use master or slave database to pull count (Optional. Defaults to DB_REPLICA) * @return bool|MWTimestamp */ public function getLastUnreadMessageTime( $cached = true, $dbSource = DB_REPLICA ) { @@ -271,7 +271,7 @@ * If $wgEchoCrossWikiNotifications is disabled, the $global parameter is ignored. * * @param bool $cached Set to false to bypass the cache. (Optional. Defaults to true) -* @param int $dbSource Use master or slave database to pull count (Optional. Defaults to DB_SLAVE) +* @param int $dbSource Use master or slave database to pull count (Optional. Defaults to DB_REPLICA) * @param string $section Notification section * @param bool|string $global Whether to include foreign notifications. If set to 'preference', uses the user's preference. * @return bool|MWTimestamp Timestamp of latest unread message, or false if there are no unread messages. diff --git a/includes/controller/NotificationController.php b/includes/controller/NotificationController.php index ca142d2..670a25c 100644 --- a/includes/controller/NotificationController.php +++ b/includes/controller/NotificationController.php @@ -49,15 +49,15 @@ } /** - * Format the notification count as a string. This should only be used for an - * isolated string count, e.g. as displayed in personal tools or returned by the API. - * - * If using it in sentence context, pass the value from getCappedNotificationCount - * into a message and use PLURAL. Example:
[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Improve some parameter docs
Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/384222 ) Change subject: Improve some parameter docs .. Improve some parameter docs Change-Id: Idd5787928b87f5af63864dc626cb603f281515d7 --- M includes/api/ApiEchoArticleReminder.php M includes/api/ApiEchoMarkRead.php M includes/api/ApiEchoMarkSeen.php M includes/api/ApiEchoNotifications.php M includes/api/ApiEchoUnreadNotificationPages.php M includes/controller/NotificationController.php M includes/jobs/NotificationDeleteJob.php M includes/mapper/AbstractMapper.php M includes/ooui/LabelIconWidget.php M phpcs.xml 10 files changed, 19 insertions(+), 21 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo refs/changes/22/384222/1 diff --git a/includes/api/ApiEchoArticleReminder.php b/includes/api/ApiEchoArticleReminder.php index 5ed2679..bc76dac 100644 --- a/includes/api/ApiEchoArticleReminder.php +++ b/includes/api/ApiEchoArticleReminder.php @@ -90,7 +90,7 @@ } /** -* @see ApiBase::getExamplesMessages() +* @inheritDoc */ protected function getExamplesMessages() { $todayDate = new DateTime(); diff --git a/includes/api/ApiEchoMarkRead.php b/includes/api/ApiEchoMarkRead.php index 1b264e9..87305f8 100644 --- a/includes/api/ApiEchoMarkRead.php +++ b/includes/api/ApiEchoMarkRead.php @@ -92,7 +92,7 @@ } /** -* @see ApiBase::getExamplesMessages() +* @inheritDoc */ protected function getExamplesMessages() { return [ diff --git a/includes/api/ApiEchoMarkSeen.php b/includes/api/ApiEchoMarkSeen.php index d06852a..e00520e 100644 --- a/includes/api/ApiEchoMarkSeen.php +++ b/includes/api/ApiEchoMarkSeen.php @@ -65,7 +65,7 @@ } /** -* @see ApiBase::getExamplesMessages() +* @inheritDoc */ protected function getExamplesMessages() { return [ diff --git a/includes/api/ApiEchoNotifications.php b/includes/api/ApiEchoNotifications.php index 62e406c..4a2392b 100644 --- a/includes/api/ApiEchoNotifications.php +++ b/includes/api/ApiEchoNotifications.php @@ -630,8 +630,7 @@ } /** -* @see ApiBase::getExamplesMessages() -* @return array +* @inheritDoc */ protected function getExamplesMessages() { return [ diff --git a/includes/api/ApiEchoUnreadNotificationPages.php b/includes/api/ApiEchoUnreadNotificationPages.php index 64f2af7..8b89d8b 100644 --- a/includes/api/ApiEchoUnreadNotificationPages.php +++ b/includes/api/ApiEchoUnreadNotificationPages.php @@ -198,7 +198,7 @@ } /** -* @see ApiBase::getExamplesMessages() +* @inheritDoc */ protected function getExamplesMessages() { return [ diff --git a/includes/controller/NotificationController.php b/includes/controller/NotificationController.php index ca142d2..670a25c 100644 --- a/includes/controller/NotificationController.php +++ b/includes/controller/NotificationController.php @@ -49,15 +49,15 @@ } /** - * Format the notification count as a string. This should only be used for an - * isolated string count, e.g. as displayed in personal tools or returned by the API. - * - * If using it in sentence context, pass the value from getCappedNotificationCount - * into a message and use PLURAL. Example: notification-bundle-header-page-linked - * - * @param int $count Notification count - * @return string Formatted count, after applying cap then formatting to string - */ +* Format the notification count as a string. This should only be used for an +* isolated string count, e.g. as displayed in personal tools or returned by the API. +* +* If using it in sentence context, pass the value from getCappedNotificationCount +* into a message and use PLURAL. Example: notification-bundle-header-page-linked +* +* @param int $count Notification count +* @return string Formatted count, after applying cap then formatting to string +*/ public static function formatNotificationCount( $count ) { $cappedCount = self::getCappedNotificationCount( $count ); diff --git a/includes/jobs/NotificationDeleteJob.php b/includes/jobs/NotificationDeleteJob.php index 2b6064e..b8d565f 100644 --- a/includes/jobs/NotificationDeleteJob.php +++ b/includes/jobs/NotificationDeleteJob.php @@ -30,6 +30,7 @@ /** * Run the job of finding & deleting older notifications +* @return true */ public function run() { global $wgEchoMaxUpdateCount; diff --git a/includes/mapper/AbstractMapper.php b/includes/mapper/AbstractMapper.php index d9603e0..b5a9d22 100644 ---
[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Improve some parameter docs
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/370819 ) Change subject: Improve some parameter docs .. Improve some parameter docs Change-Id: Ie71fb080926781f2905e6264be060203c56185ea --- M Hooks.php M composer.json M includes/AttributeManager.php M includes/Bundleable.php M includes/ContainmentSet.php M includes/DiffParser.php M includes/EmailBatch.php M includes/NotifUser.php M includes/Notifier.php M includes/UserLocator.php M includes/api/ApiEchoNotifications.php M includes/cache/LocalCache.php M includes/cache/RevisionLocalCache.php M includes/cache/TitleLocalCache.php M includes/controller/NotificationController.php M includes/formatters/EchoHtmlDigestEmailFormatter.php M includes/mapper/EventMapper.php M includes/model/Event.php M includes/model/Notification.php M includes/schemaUpdate.php M includes/special/SpecialNotificationsMarkRead.php M phpcs.xml 22 files changed, 184 insertions(+), 167 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/Hooks.php b/Hooks.php index b3bd910..8e3db35 100644 --- a/Hooks.php +++ b/Hooks.php @@ -77,7 +77,7 @@ * ResourceLoaderTestModules hook handler * @see https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderTestModules * -* @param array $testModules +* @param array &$testModules * @param ResourceLoader $resourceLoader * @return bool */ @@ -127,6 +127,7 @@ /** * Handler for ResourceLoaderRegisterModules hook +* @param ResourceLoader &$resourceLoader */ public static function onResourceLoaderRegisterModules( ResourceLoader &$resourceLoader ) { global $wgEchoEventLoggingSchemas; @@ -178,7 +179,7 @@ } /** -* @param $updater DatabaseUpdater object +* @param DatabaseUpdater $updater */ public static function onLoadExtensionSchemaUpdates( DatabaseUpdater $updater ) { global $wgEchoCluster; @@ -234,8 +235,8 @@ /** * Handler for EchoGetBundleRule hook, which defines the bundle rule for each notification * -* @param $event EchoEvent -* @param $bundleString string Determines how the notification should be bundled, for example, +* @param EchoEvent $event +* @param string &$bundleString Determines how the notification should be bundled, for example, * talk page notification is bundled based on namespace and title, the bundle string would be * 'edit-user-talk-' + namespace + title, email digest/email bundling would use this hash as * a key to identify bundle-able event. For web bundling, we bundle further based on user's @@ -272,8 +273,8 @@ * Handler for the GetBetaFeaturePreferences hook. * @see https://www.mediawiki.org/wiki/Manual:Hooks/GetBetaFeaturePreferences * -* @param $user User to get preferences for -* @param &$preferences Preferences array +* @param User $user User to get preferences for +* @param array &$preferences Preferences array * * @return bool true in all cases */ @@ -302,8 +303,8 @@ * Handler for GetPreferences hook. * @see http://www.mediawiki.org/wiki/Manual:Hooks/GetPreferences * -* @param $user User to get preferences for -* @param &$preferences Preferences array +* @param User $user User to get preferences for +* @param array &$preferences Preferences array * * @throws MWException * @return bool true in all cases @@ -501,7 +502,7 @@ /** * Test whether email address change is supposed to be allowed -* @return boolean +* @return bool */ private static function isEmailChangeAllowed() { global $wgAuth, $wgDisableAuthManager; @@ -516,18 +517,18 @@ /** * Handler for PageContentSaveComplete hook * @see http://www.mediawiki.org/wiki/Manual:Hooks/PageContentSaveComplete -* @param $article Article edited -* @param $user User who edited -* @param $content Content New article text -* @param $summary string Edit summary -* @param $minoredit bool Minor edit or not -* @param $watchthis bool Watch this article? -* @param $sectionanchor string Section that was edited -* @param $flags int Edit flags -* @param $revision Revision that was created -* @param $status Status -* @param $baseRevId Int -* @param $undidRevId Int +* @param Article &$article Article edited +* @param User &$user User who edited +* @param Content $content New article text +* @param string $summary Edit summary +* @param bool $minoredit Minor
[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Improve some parameter docs
Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/370819 ) Change subject: Improve some parameter docs .. Improve some parameter docs Change-Id: Ie71fb080926781f2905e6264be060203c56185ea --- M Hooks.php M composer.json M includes/AttributeManager.php M includes/Bundleable.php M includes/ContainmentSet.php M includes/DiffParser.php M includes/EmailBatch.php M includes/NotifUser.php M includes/Notifier.php M includes/UserLocator.php M includes/api/ApiEchoNotifications.php M includes/cache/LocalCache.php M includes/cache/RevisionLocalCache.php M includes/cache/TitleLocalCache.php M includes/controller/NotificationController.php M includes/formatters/EchoHtmlDigestEmailFormatter.php M includes/mapper/EventMapper.php M includes/model/Event.php M includes/model/Notification.php M includes/schemaUpdate.php M includes/special/SpecialNotificationsMarkRead.php M phpcs.xml 22 files changed, 184 insertions(+), 167 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo refs/changes/19/370819/1 diff --git a/Hooks.php b/Hooks.php index b3bd910..8e3db35 100644 --- a/Hooks.php +++ b/Hooks.php @@ -77,7 +77,7 @@ * ResourceLoaderTestModules hook handler * @see https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderTestModules * -* @param array $testModules +* @param array &$testModules * @param ResourceLoader $resourceLoader * @return bool */ @@ -127,6 +127,7 @@ /** * Handler for ResourceLoaderRegisterModules hook +* @param ResourceLoader &$resourceLoader */ public static function onResourceLoaderRegisterModules( ResourceLoader &$resourceLoader ) { global $wgEchoEventLoggingSchemas; @@ -178,7 +179,7 @@ } /** -* @param $updater DatabaseUpdater object +* @param DatabaseUpdater $updater */ public static function onLoadExtensionSchemaUpdates( DatabaseUpdater $updater ) { global $wgEchoCluster; @@ -234,8 +235,8 @@ /** * Handler for EchoGetBundleRule hook, which defines the bundle rule for each notification * -* @param $event EchoEvent -* @param $bundleString string Determines how the notification should be bundled, for example, +* @param EchoEvent $event +* @param string &$bundleString Determines how the notification should be bundled, for example, * talk page notification is bundled based on namespace and title, the bundle string would be * 'edit-user-talk-' + namespace + title, email digest/email bundling would use this hash as * a key to identify bundle-able event. For web bundling, we bundle further based on user's @@ -272,8 +273,8 @@ * Handler for the GetBetaFeaturePreferences hook. * @see https://www.mediawiki.org/wiki/Manual:Hooks/GetBetaFeaturePreferences * -* @param $user User to get preferences for -* @param &$preferences Preferences array +* @param User $user User to get preferences for +* @param array &$preferences Preferences array * * @return bool true in all cases */ @@ -302,8 +303,8 @@ * Handler for GetPreferences hook. * @see http://www.mediawiki.org/wiki/Manual:Hooks/GetPreferences * -* @param $user User to get preferences for -* @param &$preferences Preferences array +* @param User $user User to get preferences for +* @param array &$preferences Preferences array * * @throws MWException * @return bool true in all cases @@ -501,7 +502,7 @@ /** * Test whether email address change is supposed to be allowed -* @return boolean +* @return bool */ private static function isEmailChangeAllowed() { global $wgAuth, $wgDisableAuthManager; @@ -516,18 +517,18 @@ /** * Handler for PageContentSaveComplete hook * @see http://www.mediawiki.org/wiki/Manual:Hooks/PageContentSaveComplete -* @param $article Article edited -* @param $user User who edited -* @param $content Content New article text -* @param $summary string Edit summary -* @param $minoredit bool Minor edit or not -* @param $watchthis bool Watch this article? -* @param $sectionanchor string Section that was edited -* @param $flags int Edit flags -* @param $revision Revision that was created -* @param $status Status -* @param $baseRevId Int -* @param $undidRevId Int +* @param Article &$article Article edited +* @param User &$user User who edited +* @param Content $content New article text +* @param string $summary Edit summary +* @param bool