jenkins-bot has submitted this change and it was merged.

Change subject: Made PHPStorm happy on includes/Hooks.php
......................................................................


Made PHPStorm happy on includes/Hooks.php

Mostly doc fixes

Change-Id: I52f71ee35918becfdeded3c1de4988dd53c85535
---
M includes/Hooks.php
1 file changed, 92 insertions(+), 30 deletions(-)

Approvals:
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Hooks.php b/includes/Hooks.php
index de5d5d8..73755d5 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -40,6 +40,9 @@
 
        /**
         * Ask the ORES server for scores on this recent change
+        *
+        * @param RecentChange $rc
+        * @return bool|null
         */
        public static function onRecentChange_save( RecentChange $rc ) {
                global $wgOresExcludeBots, $wgOresEnabledNamespaces;
@@ -50,8 +53,9 @@
                // Check if we actually want score for this namespace
                $ns = $rc->getAttribute( 'rc_namespace' );
                if ( $wgOresEnabledNamespaces &&
-                               !( isset( $wgOresEnabledNamespaces[$ns] ) &&
-                               $wgOresEnabledNamespaces[$ns] ) ) {
+                       !( isset( $wgOresEnabledNamespaces[$ns] ) &&
+                       $wgOresEnabledNamespaces[$ns] )
+               ) {
                        return true;
                }
 
@@ -82,7 +86,10 @@
         * @param $filters
         * @return bool
         */
-       public static function onChangesListSpecialPageFilters( 
ChangesListSpecialPage $clsp, &$filters ) {
+       public static function onChangesListSpecialPageFilters(
+               ChangesListSpecialPage $clsp,
+               &$filters
+       ) {
                if ( !self::oresEnabled( $clsp->getUser() ) || 
!self::isModelEnabled( 'damaging' ) ) {
                        return true;
                }
@@ -109,7 +116,7 @@
        /**
         * Pull in ORES score columns during recent changes queries
         *
-        * @param $name
+        * @param string $name
         * @param array $tables
         * @param array $fields
         * @param array $conds
@@ -142,20 +149,25 @@
 
                $conds[] = '(oresm_is_current != 0 OR oresm_is_current IS 
NULL)';
 
-               $join_conds['ores_classification'] = [ 'LEFT JOIN',
+               $join_conds['ores_classification'] = [
+                       'LEFT JOIN',
                        'rc_this_oldid = oresc_rev ' .
-                       'AND oresc_class = 1' ];
+                       'AND oresc_class = 1'
+               ];
 
-               $join_conds['ores_model'] = [ 'LEFT JOIN',
+               $join_conds['ores_model'] = [
+                       'LEFT JOIN',
                        'oresc_model = oresm_id ' .
                        'AND oresm_is_current = 1'
                ];
 
                if ( self::isModelEnabled( 'damaging' ) && $opts->getValue( 
'hidenondamaging' ) ) {
                        // Override the join conditions.
-                       $join_conds['ores_classification'] = [ 'INNER JOIN',
+                       $join_conds['ores_classification'] = [
+                               'INNER JOIN',
                                'rc_this_oldid = oresc_rev ' .
-                               'AND oresc_class = 1' ];
+                               'AND oresc_class = 1'
+                       ];
 
                        // Filter out non-damaging edits.
                        $conds[] = 'oresc_probability > '
@@ -174,10 +186,15 @@
         * @param array $data
         * @param RCCacheEntry[] $block
         * @param RCCacheEntry $rcObj
+        * @param string[] $classes
         * @return bool
         */
-       public static function onEnhancedChangesListModifyLineData( 
EnhancedChangesList $ecl, array &$data,
-               array $block, RCCacheEntry $rcObj, array &$classes
+       public static function onEnhancedChangesListModifyLineData(
+               EnhancedChangesList $ecl,
+               array &$data,
+               array $block,
+               RCCacheEntry $rcObj,
+               array &$classes
        ) {
                if ( !self::oresEnabled( $ecl->getUser() ) ) {
                        return true;
@@ -196,8 +213,10 @@
         * @param RCCacheEntry $rcObj
         * @return bool
         */
-       public static function onEnhancedChangesListModifyBlockLineData( 
EnhancedChangesList $ecl,
-               array &$data, RCCacheEntry $rcObj
+       public static function onEnhancedChangesListModifyBlockLineData(
+               EnhancedChangesList $ecl,
+               array &$data,
+               RCCacheEntry $rcObj
        ) {
                if ( !self::oresEnabled( $ecl->getUser() ) ) {
                        return true;
@@ -219,8 +238,11 @@
         *
         * @return bool
         */
-       public static function onOldChangesListRecentChangesLine( ChangesList 
&$changesList, &$s,
-               $rc, &$classes = []
+       public static function onOldChangesListRecentChangesLine(
+               ChangesList &$changesList,
+               &$s,
+               $rc,
+               &$classes = []
        ) {
                if ( !self::oresEnabled( $changesList->getUser() ) ) {
                        return true;
@@ -234,7 +256,7 @@
                        }
                        $classes[] = 'damaging';
                        $parts = explode( $separator, $s );
-                       $parts[1] = $changesList->flag( 'damaging' ) . 
$parts[1];
+                       $parts[1] = ChangesList::flag( 'damaging' ) . $parts[1];
                        $s = implode( $separator, $parts );
                }
 
@@ -246,8 +268,12 @@
         *
         * @param ContribsPager $pager
         * @param array $query
+        * @return bool|null
         */
-       public static function onContribsGetQueryInfo( ContribsPager $pager, 
&$query ) {
+       public static function onContribsGetQueryInfo(
+               ContribsPager $pager,
+               &$query
+       ) {
                if ( !self::oresEnabled( $pager->getUser() ) ) {
                        return true;
                }
@@ -267,31 +293,40 @@
 
                $query['conds'][] = '(oresm_is_current != 0 OR oresm_is_current 
IS NULL)';
 
-               $query['join_conds']['ores_classification'] = [ 'LEFT JOIN',
+               $query['join_conds']['ores_classification'] = [
+                       'LEFT JOIN',
                        'rev_id = oresc_rev ' .
-                       'AND oresc_class = 1' ];
+                       'AND oresc_class = 1'
+               ];
 
-               $query['join_conds']['ores_model'] = [ 'LEFT JOIN',
+               $query['join_conds']['ores_model'] = [
+                       'LEFT JOIN',
                        'oresc_model = oresm_id ' .
-                       'AND oresm_is_current = 1' ];
+                       'AND oresm_is_current = 1'
+               ];
 
                if (
                        self::isModelEnabled( 'damaging' ) &&
                        $pager->getContext()->getRequest()->getVal( 
'hidenondamaging' )
                ) {
                        // Override the join conditions.
-                       $join_conds['ores_classification'] = [ 'INNER JOIN',
+                       $join_conds['ores_classification'] = [
+                               'INNER JOIN',
                                'rc_this_oldid = oresc_rev ' .
-                               'AND oresc_class = 1' ];
+                               'AND oresc_class = 1'
+                       ];
 
                        // Filter out non-damaging edits.
                        $query['conds'][] = 'oresc_probability > '
                                . $dbr->addQuotes( $threshold );
                }
+               return true;
        }
 
        public static function onSpecialContributionsFormatRowFlags(
-               RequestContext $context, $row, array &$flags
+               RequestContext $context,
+               $row,
+               array &$flags
        ) {
                if ( !self::oresEnabled( $context->getUser() ) ) {
                        return true;
@@ -306,10 +341,14 @@
                        // Prepend the "r" flag
                        array_unshift( $flags, ChangesList::flag( 'damaging' ) 
);
                }
+               return true;
        }
 
        public static function onContributionsLineEnding(
-               ContribsPager $pager, &$ret, $row, array &$classes
+               ContribsPager $pager,
+               &$ret,
+               $row,
+               array &$classes
        ) {
                if ( !self::oresEnabled( $pager->getUser() ) ) {
                        return true;
@@ -324,13 +363,19 @@
                        // Add the damaging class
                        $classes[] = 'damaging';
                }
+               return true;
        }
 
        /**
         * Hook into Special:Contributions filters
+        *
+        * @param SpecialContributions $page
+        * @param string HTML[] $filters
+        * @return bool
         */
        public static function onSpecialContributionsGetFormFilters(
-               SpecialContributions $page, array &$filters
+               SpecialContributions $page,
+               array &$filters
        ) {
                if ( !self::oresEnabled( $page->getUser() ) || 
!self::isModelEnabled( 'damaging' ) ) {
                        return true;
@@ -353,9 +398,15 @@
 
        /**
         * Internal helper to label matching rows
+        *
+        * @param RCCacheEntry $rcObj
+        * @param string[]
+        * @param string[]
         */
-       protected static function processRecentChangesList( RCCacheEntry $rcObj,
-               array &$data, array &$classes = []
+       protected static function processRecentChangesList(
+               RCCacheEntry $rcObj,
+               array &$data,
+               array &$classes = []
        ) {
                $damaging = self::getScoreRecentChangesList( $rcObj );
                if ( $damaging ) {
@@ -397,8 +448,12 @@
        /**
         * GetPreferences hook, adding ORES section, letting people choose a 
threshold
         * Also let people make hidenondamaging default
+        *
+        * @param User $user
+        * @param string[] $preferences
+        * @return bool
         */
-       public static function onGetPreferences( $user, &$preferences ) {
+       public static function onGetPreferences( User $user, array 
&$preferences ) {
                global $wgOresDamagingThresholds;
 
                if ( !self::oresEnabled( $user ) || !self::isModelEnabled( 
'damaging' ) ) {
@@ -435,6 +490,10 @@
 
        /**
         * Add CSS styles to output page
+        *
+        * @param OutputPage $out
+        * @param Skin $skin
+        * @return bool
         */
        public static function onBeforePageDisplay( OutputPage &$out, Skin 
&$skin ) {
                if ( !self::oresEnabled( $out->getUser() ) ) {
@@ -446,8 +505,11 @@
 
        /**
         * Make a beta feature
+        *
+        * @param User $user
+        * @param string[]
         */
-       public static function onGetBetaFeaturePreferences( $user, &$prefs ) {
+       public static function onGetBetaFeaturePreferences( User $user, array 
&$prefs ) {
                global $wgExtensionAssetsPath;
 
                $prefs['ores-enabled'] = [

-- 
To view, visit https://gerrit.wikimedia.org/r/312708
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I52f71ee35918becfdeded3c1de4988dd53c85535
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/ORES
Gerrit-Branch: master
Gerrit-Owner: Ladsgroup <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to