jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/331840 )

Change subject: Use "self" instead of repeating the class name
......................................................................


Use "self" instead of repeating the class name

This patch also removes a few non-informative comments I found while
globally searching for candidates that can be replaced with "self".

Change-Id: I35ec90e0b7434d0c863015de6ae12c381d34a37f
---
M client/includes/Hooks/DataUpdateHookHandlers.php
M client/includes/Hooks/NoLangLinkHandler.php
M client/includes/Hooks/ParserOutputUpdateHookHandlers.php
M repo/includes/ClaimSummaryBuilder.php
M repo/includes/Content/ItemContent.php
M repo/includes/Content/PropertyContent.php
M repo/includes/Hooks/LabelPrefetchHookHandlers.php
7 files changed, 14 insertions(+), 11 deletions(-)

Approvals:
  Jonas Kress (WMDE): Looks good to me, approved
  jenkins-bot: Verified



diff --git a/client/includes/Hooks/DataUpdateHookHandlers.php 
b/client/includes/Hooks/DataUpdateHookHandlers.php
index 32f348a..28196c4 100644
--- a/client/includes/Hooks/DataUpdateHookHandlers.php
+++ b/client/includes/Hooks/DataUpdateHookHandlers.php
@@ -44,8 +44,11 @@
         */
        private $jobScheduler;
 
+       /**
+        * @return self
+        */
        public static function newFromGlobalState() {
-               return new DataUpdateHookHandlers(
+               return new self(
                        
WikibaseClient::getDefaultInstance()->getStore()->getUsageUpdater(),
                        JobQueueGroup::singleton()
                );
diff --git a/client/includes/Hooks/NoLangLinkHandler.php 
b/client/includes/Hooks/NoLangLinkHandler.php
index 4803a49..1de6693 100644
--- a/client/includes/Hooks/NoLangLinkHandler.php
+++ b/client/includes/Hooks/NoLangLinkHandler.php
@@ -43,6 +43,9 @@
                $handler->doHandle( $parser, $langs );
        }
 
+       /**
+        * @return self
+        */
        private static function newFromGlobalState() {
                $wikibaseClient = WikibaseClient::getDefaultInstance();
                $settings = $wikibaseClient->getSettings();
@@ -52,7 +55,7 @@
                        $settings->getSetting( 'namespaces' )
                );
 
-               return new NoLangLinkHandler( $namespaceChecker );
+               return new self( $namespaceChecker );
        }
 
        public function __construct( NamespaceChecker $namespaceChecker ) {
diff --git a/client/includes/Hooks/ParserOutputUpdateHookHandlers.php 
b/client/includes/Hooks/ParserOutputUpdateHookHandlers.php
index 0620588..ddaeea5 100644
--- a/client/includes/Hooks/ParserOutputUpdateHookHandlers.php
+++ b/client/includes/Hooks/ParserOutputUpdateHookHandlers.php
@@ -37,13 +37,16 @@
         */
        private $parserOutputDataUpdater;
 
+       /**
+        * @return self
+        */
        public static function newFromGlobalState() {
                global $wgLang;
                StubUserLang::unstub( $wgLang );
 
                $wikibaseClient = WikibaseClient::getDefaultInstance();
 
-               return new ParserOutputUpdateHookHandlers(
+               return new self(
                        $wikibaseClient->getNamespaceChecker(),
                        $wikibaseClient->getLangLinkHandler(),
                        $wikibaseClient->getParserOutputDataUpdater()
diff --git a/repo/includes/ClaimSummaryBuilder.php 
b/repo/includes/ClaimSummaryBuilder.php
index 40388c0..0badd77 100644
--- a/repo/includes/ClaimSummaryBuilder.php
+++ b/repo/includes/ClaimSummaryBuilder.php
@@ -28,8 +28,6 @@
        private $claimDiffer;
 
        /**
-        * Constructs a new ClaimSummaryBuilder
-        *
         * @since 0.4
         *
         * @param string $apiModuleName
diff --git a/repo/includes/Content/ItemContent.php 
b/repo/includes/Content/ItemContent.php
index 4a046f3..366fbe8 100644
--- a/repo/includes/Content/ItemContent.php
+++ b/repo/includes/Content/ItemContent.php
@@ -153,8 +153,6 @@
        }
 
        /**
-        * Returns a new empty ItemContent.
-        *
         * @return self
         */
        public static function newEmpty() {
diff --git a/repo/includes/Content/PropertyContent.php 
b/repo/includes/Content/PropertyContent.php
index 59e2ea2..2bfaece 100644
--- a/repo/includes/Content/PropertyContent.php
+++ b/repo/includes/Content/PropertyContent.php
@@ -66,8 +66,6 @@
        }
 
        /**
-        * Returns a new empty PropertyContent.
-        *
         * @return self
         */
        public static function newEmpty() {
diff --git a/repo/includes/Hooks/LabelPrefetchHookHandlers.php 
b/repo/includes/Hooks/LabelPrefetchHookHandlers.php
index 12fd0e4..fdce841 100644
--- a/repo/includes/Hooks/LabelPrefetchHookHandlers.php
+++ b/repo/includes/Hooks/LabelPrefetchHookHandlers.php
@@ -53,7 +53,7 @@
        private $languageCodes;
 
        /**
-        * @return null|LabelPrefetchHookHandlers
+        * @return self|null
         */
        private static function newFromGlobalState() {
                $wikibaseRepo = WikibaseRepo::getDefaultInstance();
@@ -70,7 +70,7 @@
                $languageFallbackChainFactory = 
$wikibaseRepo->getLanguageFallbackChainFactory();
                $languageFallbackChain = 
$languageFallbackChainFactory->newFromContext( $context );
 
-               return new LabelPrefetchHookHandlers(
+               return new self(
                        $termBuffer,
                        $wikibaseRepo->getEntityIdLookup(),
                        new TitleFactory(),

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I35ec90e0b7434d0c863015de6ae12c381d34a37f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.de>
Gerrit-Reviewer: Addshore <addshorew...@gmail.com>
Gerrit-Reviewer: Aude <aude.w...@gmail.com>
Gerrit-Reviewer: Jonas Kress (WMDE) <jonas.kr...@wikimedia.de>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to