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

Change subject: Rename ParserOutputHooks to SidebarHookHandlers
......................................................................


Rename ParserOutputHooks to SidebarHookHandlers

The hook handler functions in this class funnel information
from the Parser via ParserOutput and OutputPage into SkinTemplate,
in order to inject links into the sidebar.

Change-Id: I27c7e487d48f11a13a43b256c0790ec4c94c6563
---
M client/WikibaseClient.php
R client/includes/hooks/SidebarHookHandlers.php
R client/tests/phpunit/includes/hooks/SidebarHookHandlersTest.php
3 files changed, 16 insertions(+), 14 deletions(-)

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



diff --git a/client/WikibaseClient.php b/client/WikibaseClient.php
index 759b6e9..5c4337a 100644
--- a/client/WikibaseClient.php
+++ b/client/WikibaseClient.php
@@ -91,9 +91,9 @@
        $wgHooks['UnitTestsList'][]                             = 
'\Wikibase\ClientHooks::registerUnitTests';
        $wgHooks['BaseTemplateToolbox'][]                       = 
'\Wikibase\ClientHooks::onBaseTemplateToolbox';
        $wgHooks['OldChangesListRecentChangesLine'][]           = 
'\Wikibase\ClientHooks::onOldChangesListRecentChangesLine';
-       $wgHooks['OutputPageParserOutput'][]            = 
'\Wikibase\Client\Hooks\ParserOutputHooks::onOutputPageParserOutput';
-       $wgHooks['SkinTemplateGetLanguageLink'][]               = 
'\Wikibase\Client\Hooks\ParserOutputHooks::onSkinTemplateGetLanguageLink';
-       $wgHooks['ParserAfterParse'][]                          = 
'\Wikibase\Client\Hooks\ParserOutputHooks::onParserAfterParse';
+       $wgHooks['OutputPageParserOutput'][]            = 
'\Wikibase\Client\Hooks\SidebarHookHandlers::onOutputPageParserOutput';
+       $wgHooks['SkinTemplateGetLanguageLink'][]               = 
'\Wikibase\Client\Hooks\SidebarHookHandlers::onSkinTemplateGetLanguageLink';
+       $wgHooks['ParserAfterParse'][]                          = 
'\Wikibase\Client\Hooks\SidebarHookHandlers::onParserAfterParse';
        $wgHooks['ParserFirstCallInit'][]                       = 
'\Wikibase\ClientHooks::onParserFirstCallInit';
        $wgHooks['MagicWordwgVariableIDs'][]                    = 
'\Wikibase\ClientHooks::onMagicWordwgVariableIDs';
        $wgHooks['ParserGetVariableValueSwitch'][]              = 
'\Wikibase\ClientHooks::onParserGetVariableValueSwitch';
diff --git a/client/includes/hooks/ParserOutputHooks.php 
b/client/includes/hooks/SidebarHookHandlers.php
similarity index 97%
rename from client/includes/hooks/ParserOutputHooks.php
rename to client/includes/hooks/SidebarHookHandlers.php
index 3261fb8..ea562a5 100644
--- a/client/includes/hooks/ParserOutputHooks.php
+++ b/client/includes/hooks/SidebarHookHandlers.php
@@ -18,7 +18,7 @@
  * ParserOutput related hook handlers.
  *
  * This class has a static interface for use with MediaWiki's hook mechanism; 
the static
- * handler functions will create a new instance of ParserOutputHooks and then 
call the
+ * handler functions will create a new instance of SidebarHookHandlers and 
then call the
  * corresponding member function on that.
  *
  * @since 0.5.
@@ -29,7 +29,7 @@
  * @author Jeroen De Dauw < [email protected] >
  * @author Marius Hoch < [email protected] >
  */
-class ParserOutputHooks {
+class SidebarHookHandlers {
 
        /**
         * @var NamespaceChecker
@@ -85,7 +85,7 @@
                        $settings->getSetting( 'sortPrepend' )
                );
 
-               return new ParserOutputHooks(
+               return new SidebarHookHandlers(
                        $namespaceChecker,
                        $langLinkHandler,
                        $badgeDisplay,
diff --git a/client/tests/phpunit/includes/hooks/ParserOutputHooksTest.php 
b/client/tests/phpunit/includes/hooks/SidebarHookHandlersTest.php
similarity index 95%
rename from client/tests/phpunit/includes/hooks/ParserOutputHooksTest.php
rename to client/tests/phpunit/includes/hooks/SidebarHookHandlersTest.php
index 3689594..728e4c4 100644
--- a/client/tests/phpunit/includes/hooks/ParserOutputHooksTest.php
+++ b/client/tests/phpunit/includes/hooks/SidebarHookHandlersTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Wikibase\Test;
+namespace Wikibase\Client\Test\Hooks;
 
 use FauxRequest;
 use Language;
@@ -17,7 +17,7 @@
 use Wikibase\Client\ClientSiteLinkLookup;
 use Wikibase\Client\Hooks\LanguageLinkBadgeDisplay;
 use Wikibase\Client\Hooks\OtherProjectsSidebarGenerator;
-use Wikibase\Client\Hooks\ParserOutputHooks;
+use Wikibase\Client\Hooks\SidebarHookHandlers;
 use Wikibase\DataModel\Entity\Item;
 use Wikibase\DataModel\Entity\ItemId;
 use Wikibase\DataModel\SiteLink;
@@ -27,9 +27,11 @@
 use Wikibase\NamespaceChecker;
 use Wikibase\Settings;
 use Wikibase\SettingsArray;
+use Wikibase\Test\MockRepository;
+use Wikibase\Test\MockSiteStore;
 
 /**
- * @covers Wikibase\Client\Hooks\ParserOutputHooks
+ * @covers Wikibase\Client\Hooks\SidebarHookHandlers
  *
  * @group WikibaseClient
  * @group Wikibase
@@ -38,7 +40,7 @@
  * @licence GNU GPL v2+
  * @author Daniel Kinzler
  */
-class ParserOutputHooksTest extends \MediaWikiTestCase {
+class SidebarHookHandlersTest extends \MediaWikiTestCase {
 
        /**
         * @param string $globalId
@@ -150,7 +152,7 @@
                return new SettingsArray( array_merge( $defaults, $settings ) );
        }
 
-       private function newParserOutputHooks( array $settings = array() ) {
+       private function newSidebarHookHandlers( array $settings = array() ) {
                $en = Language::factory( 'en' );
                $settings = $this->newSettings( $settings );
 
@@ -202,7 +204,7 @@
                        $settings->getSetting( 'sortPrepend' )
                );
 
-               return new ParserOutputHooks(
+               return new SidebarHookHandlers(
                        $namespaceChecker,
                        $langLinkHandler,
                        $badgeDisplay,
@@ -304,7 +306,7 @@
                array $expectedSisterLinks = null
        ) {
                $parser = $this->newParser( $title, $pagePropsBefore, array() );
-               $handler = $this->newParserOutputHooks();
+               $handler = $this->newSidebarHookHandlers();
 
                $text = '';
                $stripState = new StripState( 'x' );
@@ -343,7 +345,7 @@
                        'wikibase-otherprojects-sidebar' => $sisterLinks,
                );
 
-               $handler = $this->newParserOutputHooks();
+               $handler = $this->newSidebarHookHandlers();
 
                $parserOutput = new ParserOutput();
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I27c7e487d48f11a13a43b256c0790ec4c94c6563
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Bene <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: JanZerebecki <[email protected]>
Gerrit-Reviewer: Jeroen De Dauw <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to