Thiemo Mättig (WMDE) has uploaded a new change for review.

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

Change subject: Replace Iterator<Generics> with valid PHPDoc syntax
......................................................................

Replace Iterator<Generics> with valid PHPDoc syntax

This is split from I5a2e356. This patch focuses on a single change:
Stuff like @param Iterator<Foo> is not understood by PHPStorm and other
tools. Generics do not exist in PHP.

This patch does *not* replace Iterator with Traversable. This is done
in later patches.

Change-Id: I8718218da595b8f601704bd8af328157b7352f59
---
M client/includes/Changes/AffectedPagesFinder.php
M client/includes/Usage/NullUsageTracker.php
M client/includes/Usage/SiteLinkUsageLookup.php
M client/includes/Usage/Sql/EntityUsageTable.php
M client/includes/Usage/Sql/SqlUsageTracker.php
M client/includes/Usage/UsageLookup.php
M client/tests/phpunit/includes/Changes/AffectedPagesFinderTest.php
7 files changed, 10 insertions(+), 9 deletions(-)


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

diff --git a/client/includes/Changes/AffectedPagesFinder.php 
b/client/includes/Changes/AffectedPagesFinder.php
index 712d1c1..a6d9aa7 100644
--- a/client/includes/Changes/AffectedPagesFinder.php
+++ b/client/includes/Changes/AffectedPagesFinder.php
@@ -178,7 +178,7 @@
         *
         * @param EntityChange $change
         *
-        * @return Iterator<PageEntityUsages>
+        * @return Iterator of PageEntityUsages
         */
        private function getAffectedPages( EntityChange $change ) {
                $entityId = $change->getEntityId();
@@ -276,9 +276,9 @@
         * Filters updates based on namespace. This removes duplicates, 
non-existing pages, and pages from
         * namespaces that are not considered "enabled" by the namespace 
checker.
         *
-        * @param PageEntityUsages[]|Iterator<PageEntityUsages> $updates
+        * @param PageEntityUsages[]|Iterator $usages An array or iterator of 
PageEntityUsages.
         *
-        * @return Iterator<PageEntityUsages>
+        * @return Iterator of PageEntityUsages
         */
        private function filterUpdates( $usages ) {
                $titlesToUpdate = array();
diff --git a/client/includes/Usage/NullUsageTracker.php 
b/client/includes/Usage/NullUsageTracker.php
index 6464ee2..e52242a 100644
--- a/client/includes/Usage/NullUsageTracker.php
+++ b/client/includes/Usage/NullUsageTracker.php
@@ -65,7 +65,7 @@
         * @param EntityId[] $entities
         * @param string[] $aspects
         *
-        * @return Iterator<PageEntityUsages>
+        * @return Iterator Always empty.
         */
        public function getPagesUsing( array $entities, array $aspects = 
array() ) {
                return new ArrayIterator();
diff --git a/client/includes/Usage/SiteLinkUsageLookup.php 
b/client/includes/Usage/SiteLinkUsageLookup.php
index 5903d83..539e865 100644
--- a/client/includes/Usage/SiteLinkUsageLookup.php
+++ b/client/includes/Usage/SiteLinkUsageLookup.php
@@ -82,7 +82,7 @@
         * @param string[] $aspects Which aspects to consider (if omitted, all 
aspects are considered).
         * Use the EntityUsage::XXX_USAGE constants to represent aspects.
         *
-        * @return Iterator<PageEntityUsages>
+        * @return Iterator of PageEntityUsages
         * @throws UsageTrackerException
         */
        public function getPagesUsing( array $entityIds, array $aspects = 
array() ) {
diff --git a/client/includes/Usage/Sql/EntityUsageTable.php 
b/client/includes/Usage/Sql/EntityUsageTable.php
index 3e24ed8..4304c95 100644
--- a/client/includes/Usage/Sql/EntityUsageTable.php
+++ b/client/includes/Usage/Sql/EntityUsageTable.php
@@ -347,7 +347,7 @@
         * @param EntityId[] $entityIds
         * @param string[] $aspects
         *
-        * @return Iterator<PageEntityUsages> An iterator over entity usages 
grouped by page
+        * @return Iterator An iterator over PageEntityUsages grouped by page.
         */
        public function getPagesUsing( array $entityIds, array $aspects = 
array() ) {
                if ( empty( $entityIds ) ) {
diff --git a/client/includes/Usage/Sql/SqlUsageTracker.php 
b/client/includes/Usage/Sql/SqlUsageTracker.php
index 710f929..d69f75e 100644
--- a/client/includes/Usage/Sql/SqlUsageTracker.php
+++ b/client/includes/Usage/Sql/SqlUsageTracker.php
@@ -216,7 +216,7 @@
         * @param EntityId[] $entityIds
         * @param string[] $aspects
         *
-        * @return Iterator<PageEntityUsages> An iterator over entity usages 
grouped by page
+        * @return Iterator An iterator over PageEntityUsages grouped by page.
         * @throws UsageTrackerException
         */
        public function getPagesUsing( array $entityIds, array $aspects = 
array() ) {
diff --git a/client/includes/Usage/UsageLookup.php 
b/client/includes/Usage/UsageLookup.php
index 79a5c16..9ff40d0 100644
--- a/client/includes/Usage/UsageLookup.php
+++ b/client/includes/Usage/UsageLookup.php
@@ -32,7 +32,7 @@
         * @param string[] $aspects Which aspects to consider (if omitted, all 
aspects are considered).
         * Use the EntityUsage::XXX_USAGE constants to represent aspects.
         *
-        * @return Iterator<PageEntityUsages> An iterator over PageEntityUsages 
of pages using any of the given entities.
+        * @return Iterator An iterator over PageEntityUsages of pages using 
any of the given entities.
         *         If $aspects is given, only usages of these aspects are 
included in the result.
         * @throws UsageTrackerException
         */
diff --git a/client/tests/phpunit/includes/Changes/AffectedPagesFinderTest.php 
b/client/tests/phpunit/includes/Changes/AffectedPagesFinderTest.php
index 7119bf6..f86dce8 100644
--- a/client/tests/phpunit/includes/Changes/AffectedPagesFinderTest.php
+++ b/client/tests/phpunit/includes/Changes/AffectedPagesFinderTest.php
@@ -5,6 +5,7 @@
 use ArrayIterator;
 use DataValues\DataValue;
 use DataValues\StringValue;
+use Iterator;
 use Title;
 use Wikibase\Client\Changes\AffectedPagesFinder;
 use Wikibase\Client\Store\TitleFactory;
@@ -558,7 +559,7 @@
        }
 
        /**
-        * @param PageEntityUsages[]|Iterator<PageEntityUsages> $usagesPerPage
+        * @param PageEntityUsages[]|Iterator $usagesPerPage An array or 
iterator of PageEntityUsages.
         *
         * @return PageEntityUsages[]
         */

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8718218da595b8f601704bd8af328157b7352f59
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]>

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

Reply via email to