Aude has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/210699

Change subject: Improve constructor parameter naming and order in 
LangLinkHandler
......................................................................

Improve constructor parameter naming and order in LangLinkHandler

most importantly, it takes a SiteStore object and not "sites".

Change-Id: I4188f63af6601e3aeaaedd6590b06f8f17bcd176
---
M client/includes/LangLinkHandler.php
M client/includes/WikibaseClient.php
M client/tests/phpunit/includes/Hooks/ParserAfterParseHookHandlerTest.php
M client/tests/phpunit/includes/LangLinkHandlerTest.php
4 files changed, 13 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/99/210699/1

diff --git a/client/includes/LangLinkHandler.php 
b/client/includes/LangLinkHandler.php
index 32505c8..549bb06 100644
--- a/client/includes/LangLinkHandler.php
+++ b/client/includes/LangLinkHandler.php
@@ -39,11 +39,6 @@
        private $badgeDisplay;
 
        /**
-        * @var string
-        */
-       private $siteId;
-
-       /**
         * @var NamespaceChecker
         */
        private $namespaceChecker;
@@ -66,6 +61,11 @@
        /**
         * @var string
         */
+       private $siteId;
+
+       /**
+        * @var string
+        */
        private $siteGroup;
 
        /**
@@ -76,30 +76,30 @@
        /**
         * @param OtherProjectsSidebarGeneratorFactory 
$otherProjectsSidebarGeneratorFactory
         * @param LanguageLinkBadgeDisplay $badgeDisplay
-        * @param string $siteId The global site ID for the local wiki
         * @param NamespaceChecker $namespaceChecker determines which 
namespaces wikibase is enabled on
         * @param SiteLinkLookup $siteLinkLookup A site link lookup service
         * @param EntityLookup $entityLookup An entity lookup service
         * @param SiteStore $sites
+        * @param string $siteId The global site ID for the local wiki
         * @param string $siteGroup The ID of the site group to use for showing 
language links.
         */
        public function __construct(
                OtherProjectsSidebarGeneratorFactory 
$otherProjectsSidebarGeneratorFactory,
                LanguageLinkBadgeDisplay $badgeDisplay,
-               $siteId,
                NamespaceChecker $namespaceChecker,
                SiteLinkLookup $siteLinkLookup,
                EntityLookup $entityLookup,
-               SiteStore $sites,
+               SiteStore $siteStore,
+               $siteId,
                $siteGroup
        ) {
                $this->otherProjectsSidebarGeneratorFactory = 
$otherProjectsSidebarGeneratorFactory;
                $this->badgeDisplay = $badgeDisplay;
-               $this->siteId = $siteId;
                $this->namespaceChecker = $namespaceChecker;
                $this->siteLinkLookup = $siteLinkLookup;
                $this->entityLookup = $entityLookup;
-               $this->siteStore = $sites;
+               $this->siteStore = $siteStore;
+               $this->siteId = $siteId;
                $this->siteGroup = $siteGroup;
        }
 
diff --git a/client/includes/WikibaseClient.php 
b/client/includes/WikibaseClient.php
index 551e6b2..f2cf9a9 100644
--- a/client/includes/WikibaseClient.php
+++ b/client/includes/WikibaseClient.php
@@ -540,11 +540,11 @@
                        $this->langLinkHandler = new LangLinkHandler(
                                
$this->getOtherProjectsSidebarGeneratorFactory(),
                                $this->getLanguageLinkBadgeDisplay(),
-                               $this->settings->getSetting( 'siteGlobalID' ),
                                $this->getNamespaceChecker(),
                                $this->getStore()->getSiteLinkLookup(),
                                $this->getStore()->getEntityLookup(),
                                $this->getSiteStore(),
+                               $this->settings->getSetting( 'siteGlobalID' ),
                                $this->getLangLinkSiteGroup()
                        );
                }
diff --git 
a/client/tests/phpunit/includes/Hooks/ParserAfterParseHookHandlerTest.php 
b/client/tests/phpunit/includes/Hooks/ParserAfterParseHookHandlerTest.php
index 2a30e26..14ad1d6 100644
--- a/client/tests/phpunit/includes/Hooks/ParserAfterParseHookHandlerTest.php
+++ b/client/tests/phpunit/includes/Hooks/ParserAfterParseHookHandlerTest.php
@@ -173,11 +173,11 @@
                $langLinkHandler = new LangLinkHandler(
                        $this->getOtherProjectsSidebarGeneratorFactory( 
$settings, $mockRepo ),
                        $badgeDisplay,
-                       $settings->getSetting( 'siteGlobalID' ),
                        $namespaceChecker,
                        $mockRepo,
                        $mockRepo,
                        $this->getSiteStore(),
+                       $settings->getSetting( 'siteGlobalID' ),
                        $settings->getSetting( 'languageLinkSiteGroup' )
                );
 
diff --git a/client/tests/phpunit/includes/LangLinkHandlerTest.php 
b/client/tests/phpunit/includes/LangLinkHandlerTest.php
index f23ffeb..ee5ec72 100644
--- a/client/tests/phpunit/includes/LangLinkHandlerTest.php
+++ b/client/tests/phpunit/includes/LangLinkHandlerTest.php
@@ -88,11 +88,11 @@
                return new LangLinkHandler(
                        $this->getOtherProjectsSidebarGeneratorFactory( 
$otherProjects ),
                        $this->getLanguageLinkBadgeDisplay(),
-                       'srwiki',
                        new NamespaceChecker( array( NS_TALK ), array() ),
                        $this->mockRepo,
                        $this->mockRepo,
                        $siteStore,
+                       'srwiki',
                        'wikipedia'
                );
        }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4188f63af6601e3aeaaedd6590b06f8f17bcd176
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Aude <aude.w...@gmail.com>

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

Reply via email to