Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403951 )

Change subject: Improve type hints in different places
......................................................................

Improve type hints in different places

This patch adds missing type hints both in method headers as well as
documentation.

I also remove some comment blocks that repeat 100% exactly what the
method header itself already states.

Change-Id: I44dc9d7fe870a74625bb6498566834a212dcd35b
---
M src/GetSuggestions.php
M src/Hooks.php
M src/ResultBuilder.php
M src/Suggesters/SimpleSuggester.php
M src/UpdateTable/ImportContext.php
5 files changed, 7 insertions(+), 16 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PropertySuggester 
refs/changes/51/403951/1

diff --git a/src/GetSuggestions.php b/src/GetSuggestions.php
index 303ca58..585a980 100644
--- a/src/GetSuggestions.php
+++ b/src/GetSuggestions.php
@@ -148,7 +148,7 @@
         * @param int $resultSize
         * @param string $search
         * @param string $language
-        * @return array
+        * @return array[]
         */
        private function querySearchApi( $resultSize, $search, $language ) {
                $searchEntitiesParameters = new DerivativeRequest(
diff --git a/src/Hooks.php b/src/Hooks.php
index 15ac2db..8e02888 100644
--- a/src/Hooks.php
+++ b/src/Hooks.php
@@ -18,8 +18,8 @@
         * Handler for the BeforePageDisplay hook, injects special behaviour
         * for PropertySuggestions in the EntitySuggester (if page is in 
EntityNamespace)
         *
-        * @param OutputPage $out
-        * @param Skin $skin
+        * @param OutputPage &$out
+        * @param Skin &$skin
         */
        public static function onBeforePageDisplay( OutputPage &$out, Skin 
&$skin ) {
                if ( $out->getRequest()->getCheck( 'nosuggestions' ) ) {
@@ -44,9 +44,6 @@
                $out->addModules( 'ext.PropertySuggester.EntitySelector' );
        }
 
-       /**
-        * @param DatabaseUpdater $updater
-        */
        public static function onCreateSchema( DatabaseUpdater $updater ) {
                $updater->addExtensionTable(
                        'wbs_propertypairs',
diff --git a/src/ResultBuilder.php b/src/ResultBuilder.php
index 492ee9f..0b30767 100644
--- a/src/ResultBuilder.php
+++ b/src/ResultBuilder.php
@@ -91,7 +91,7 @@
        private function buildEntry( EntityId $id, array $clusteredTerms, 
Suggestion $suggestion ) {
                $entry = [
                        'id' => $id->getSerialization(),
-                       'url' => $this->entityTitleLookup->getTitleForId( $id 
)->getFullUrl(),
+                       'url' => $this->entityTitleLookup->getTitleForId( $id 
)->getFullURL(),
                        'rating' => $suggestion->getProbability(),
                ];
 
diff --git a/src/Suggesters/SimpleSuggester.php 
b/src/Suggesters/SimpleSuggester.php
index e786546..e92c10b 100644
--- a/src/Suggesters/SimpleSuggester.php
+++ b/src/Suggesters/SimpleSuggester.php
@@ -41,9 +41,6 @@
         */
        private $lb;
 
-       /**
-        * @param LoadBalancer $lb
-        */
        public function __construct( LoadBalancer $lb ) {
                $this->lb = $lb;
        }
diff --git a/src/UpdateTable/ImportContext.php 
b/src/UpdateTable/ImportContext.php
index e4235d0..c62209d 100644
--- a/src/UpdateTable/ImportContext.php
+++ b/src/UpdateTable/ImportContext.php
@@ -31,7 +31,7 @@
        private $targetTableName = "";
 
        /**
-        * @var LoadBalancer
+        * @var LoadBalancer|null
         */
        private $lb = null;
 
@@ -60,16 +60,13 @@
        }
 
        /**
-        * @return LoadBalancer
+        * @return LoadBalancer|null
         */
        public function getLb() {
                return $this->lb;
        }
 
-       /**
-        * @param LoadBalancer $lb
-        */
-       public function setLb( $lb ) {
+       public function setLb( LoadBalancer $lb ) {
                $this->lb = $lb;
        }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I44dc9d7fe870a74625bb6498566834a212dcd35b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PropertySuggester
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) <thiemo.kr...@wikimedia.de>

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

Reply via email to