Thiemo Mättig (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/366803 )

Change subject: Fix a series of very minor code smell issues
......................................................................

Fix a series of very minor code smell issues

I found these with the inspection utilities my PHPStorm provides.

The missing "return true" is a little scary. Why doesn't this fail?
It returned "null" and should fail. The reason is because the returned
value is currently entirely unused. But this caller is in core, and
instead of removing the "@return bool" from there, I decided it's
easier to fix this single outlier.

Change-Id: Ia393bb33c2448cf23cd450fec8a080760970f999
---
M includes/BuildDocument/RedirectsAndIncomingLinks.php
M includes/Job/Job.php
M includes/Updater.php
M resources/ext.cirrus.explore-similar.js
4 files changed, 8 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch 
refs/changes/03/366803/1

diff --git a/includes/BuildDocument/RedirectsAndIncomingLinks.php 
b/includes/BuildDocument/RedirectsAndIncomingLinks.php
index 32a195b..b61e818 100644
--- a/includes/BuildDocument/RedirectsAndIncomingLinks.php
+++ b/includes/BuildDocument/RedirectsAndIncomingLinks.php
@@ -88,7 +88,9 @@
                        return false;
                }
                foreach ( self::$externalLinks as $conn ) {
-                       self::$externalLinks[$conn]->realFinishBatch( $pages );
+                       /** @var self $instance */
+                       $instance = self::$externalLinks[$conn];
+                       $instance->realFinishBatch( $pages );
                }
                self::$externalLinks = null;
                return true;
diff --git a/includes/Job/Job.php b/includes/Job/Job.php
index 1daa155..551cc5d 100644
--- a/includes/Job/Job.php
+++ b/includes/Job/Job.php
@@ -76,12 +76,14 @@
 
        /**
         * Some boilerplate stuff for all jobs goes here
+        *
+        * @return bool
         */
        public function run() {
                global $wgDisableSearchUpdate, $wgPoolCounterConf;
 
                if ( $wgDisableSearchUpdate ) {
-                       return;
+                       return true;
                }
 
                // Make sure we don't flood the pool counter.  This is safe 
since this is only used
diff --git a/includes/Updater.php b/includes/Updater.php
index df08605..2f082e1 100644
--- a/includes/Updater.php
+++ b/includes/Updater.php
@@ -306,7 +306,7 @@
                        $doc = new \Elastica\Document( $delete['page'], [
                                'namespace' => $title->getNamespace(),
                                'title' => $title->getText(),
-                               'wiki' => wfWikiId(),
+                               'wiki' => wfWikiID(),
                        ] );
                        $doc->setDocAsUpsert( true );
                        $doc->setRetryOnConflict( 
$this->searchConfig->getElement( 'CirrusSearchUpdateConflictRetryCount' ) );
diff --git a/resources/ext.cirrus.explore-similar.js 
b/resources/ext.cirrus.explore-similar.js
index 31cbe00..ceafb87 100644
--- a/resources/ext.cirrus.explore-similar.js
+++ b/resources/ext.cirrus.explore-similar.js
@@ -225,7 +225,7 @@
                                                titles: articleTitle,
                                                prop: 'langlinks',
                                                llprop: 'url|autonym',
-                                               lllimit: '500',
+                                               lllimit: '500'
                                        }
                                },
                                filterApiResponse: function ( reqResponse ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia393bb33c2448cf23cd450fec8a080760970f999
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to