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

Change subject: Fix and add soft (PHPDoc) type hints
......................................................................


Fix and add soft (PHPDoc) type hints

This is a pure documentation patch, exclusively touching @param and @var
type hints, but not changing code (except for splitting a line).

Change-Id: I646fcd2fd08a0c8a3b92b4a5f09963580cdc3e55
---
M client/includes/Usage/NullSubscriptionManager.php
M 
client/tests/phpunit/includes/DataAccess/PropertyParserFunction/StatementGroupRendererFactoryTest.php
M 
client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseEntityLibraryTest.php
M client/tests/phpunit/includes/Hooks/DataUpdateHookHandlersTest.php
M repo/tests/phpunit/includes/Notifications/ChangeNotifierTest.php
M view/tests/phpunit/ItemViewTest.php
M view/tests/phpunit/PropertyViewTest.php
7 files changed, 23 insertions(+), 22 deletions(-)

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



diff --git a/client/includes/Usage/NullSubscriptionManager.php 
b/client/includes/Usage/NullSubscriptionManager.php
index 04cff86..f6154dc 100644
--- a/client/includes/Usage/NullSubscriptionManager.php
+++ b/client/includes/Usage/NullSubscriptionManager.php
@@ -13,24 +13,16 @@
 class NullSubscriptionManager implements SubscriptionManager {
 
        /**
-        * Subscribes the given subscriber to notifications about changes on 
the specified entities.
-        *
-        * @param string $subscriber Global site ID of the subscriber
-        * @param EntityId[] $entityIds The entities to subscribe to.
-        *
-        * @throws UsageTrackerException
+        * @param string $subscriber
+        * @param EntityId[] $entityIds
         */
        public function subscribe( $subscriber, array $entityIds ) {
                // NO-OP
        }
 
        /**
-        * Unsubscribes the given subscriber from notifications about changes 
on the specified entities.
-        *
-        * @param string $subscriber Global site ID of the subscriber
-        * @param EntityId[] $entityIds The entities to subscribe to.
-        *
-        * @throws UsageTrackerException
+        * @param string $subscriber
+        * @param EntityId[] $entityIds
         */
        public function unsubscribe( $subscriber, array $entityIds ) {
                // NO-OP
diff --git 
a/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/StatementGroupRendererFactoryTest.php
 
b/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/StatementGroupRendererFactoryTest.php
index c0bad46..9f2c044 100644
--- 
a/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/StatementGroupRendererFactoryTest.php
+++ 
b/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/StatementGroupRendererFactoryTest.php
@@ -221,7 +221,7 @@
        }
 
        /**
-        * @return SnakFormatter
+        * @return OutputFormatSnakFormatterFactory
         */
        private function getSnakFormatterFactory() {
                $snakFormatter = $this->getMockBuilder( SnakFormatter::class )
diff --git 
a/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseEntityLibraryTest.php
 
b/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseEntityLibraryTest.php
index 254f326..bba09cb 100644
--- 
a/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseEntityLibraryTest.php
+++ 
b/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseEntityLibraryTest.php
@@ -3,6 +3,7 @@
 namespace Wikibase\Client\Tests\DataAccess\Scribunto;
 
 use LuaSandboxFunction;
+use Scribunto_LuaEngine;
 use Scribunto_LuaStandaloneInterpreterFunction;
 use Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseEntityLibrary;
 use Wikibase\Client\WikibaseClient;
diff --git a/client/tests/phpunit/includes/Hooks/DataUpdateHookHandlersTest.php 
b/client/tests/phpunit/includes/Hooks/DataUpdateHookHandlersTest.php
index 38004c6..e79c67a 100644
--- a/client/tests/phpunit/includes/Hooks/DataUpdateHookHandlersTest.php
+++ b/client/tests/phpunit/includes/Hooks/DataUpdateHookHandlersTest.php
@@ -163,7 +163,7 @@
        }
 
        /**
-        * @param array[]|null $usages
+        * @param EntityUsage[]|null $usages
         * @param string $timestamp
         *
         * @return ParserOutput
diff --git a/repo/tests/phpunit/includes/Notifications/ChangeNotifierTest.php 
b/repo/tests/phpunit/includes/Notifications/ChangeNotifierTest.php
index 7d1d5b2..b30bd94 100644
--- a/repo/tests/phpunit/includes/Notifications/ChangeNotifierTest.php
+++ b/repo/tests/phpunit/includes/Notifications/ChangeNotifierTest.php
@@ -10,7 +10,6 @@
 use Wikibase\DataModel\Entity\EntityRedirect;
 use Wikibase\DataModel\Entity\Item;
 use Wikibase\DataModel\Entity\ItemId;
-use Wikibase\EntityContent;
 use Wikibase\ItemContent;
 use Wikibase\Repo\Notifications\ChangeNotifier;
 use Wikibase\Repo\Notifications\ChangeTransmitter;
@@ -46,7 +45,7 @@
        /**
         * @param ItemId $id
         *
-        * @return EntityContent
+        * @return ItemContent
         */
        private function makeItemContent( ItemId $id ) {
                $item = new Item( $id );
@@ -60,7 +59,7 @@
         * @param ItemId $target
         *
         * @throws RuntimeException
-        * @return EntityContent
+        * @return ItemContent
         */
        protected function makeItemRedirectContent( ItemId $id, ItemId $target 
) {
                $title = Title::newFromText( $target->getSerialization() );
@@ -236,7 +235,9 @@
                $parent = $this->makeRevision( $oldContent, $user, $revisionId 
- 1, $timestamp );
 
                $content = $this->makeItemContent( $oldContent->getEntityId() );
-               $content->getEntity()->setLabel( 'en', 'Foo' );
+               /** @var Item $item */
+               $item = $content->getEntity();
+               $item->setLabel( 'en', 'Foo' );
                $revision = $this->makeRevision( $content, $user, $revisionId, 
$timestamp, $revisionId - 1 );
 
                $notifier = $this->getChangeNotifier();
diff --git a/view/tests/phpunit/ItemViewTest.php 
b/view/tests/phpunit/ItemViewTest.php
index 2dae8c9..2048a53 100644
--- a/view/tests/phpunit/ItemViewTest.php
+++ b/view/tests/phpunit/ItemViewTest.php
@@ -5,6 +5,7 @@
 use Wikibase\DataModel\Entity\EntityId;
 use Wikibase\DataModel\Entity\Item;
 use Wikibase\DataModel\Entity\ItemId;
+use Wikibase\DataModel\Statement\Statement;
 use Wikibase\DataModel\Statement\StatementList;
 use Wikibase\View\EntityTermsView;
 use Wikibase\View\ItemView;
@@ -30,6 +31,12 @@
  */
 class ItemViewTest extends EntityViewTest {
 
+       /**
+        * @param EntityId|ItemId $id
+        * @param Statement[] $statements
+        *
+        * @return Item
+        */
        protected function makeEntity( EntityId $id, array $statements = 
array() ) {
                $item = new Item( $id );
 
@@ -46,7 +53,7 @@
         *
         * @param int|string $n
         *
-        * @return EntityId
+        * @return ItemId
         */
        protected function makeEntityId( $n ) {
                return new ItemId( "Q$n" );
diff --git a/view/tests/phpunit/PropertyViewTest.php 
b/view/tests/phpunit/PropertyViewTest.php
index 18b8844..e0819d1 100644
--- a/view/tests/phpunit/PropertyViewTest.php
+++ b/view/tests/phpunit/PropertyViewTest.php
@@ -33,10 +33,10 @@
 class PropertyViewTest extends EntityViewTest {
 
        /**
-        * @param EntityId $id
+        * @param EntityId|PropertyId $id
         * @param Statement[] $statements
         *
-        * @return EntityDocument
+        * @return Property
         */
        protected function makeEntity( EntityId $id, array $statements = 
array() ) {
                $property = Property::newFromType( 'string' );
@@ -55,7 +55,7 @@
         *
         * @param int|string $n
         *
-        * @return EntityId
+        * @return PropertyId
         */
        protected function makeEntityId( $n ) {
                return new PropertyId( "P$n" );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I646fcd2fd08a0c8a3b92b4a5f09963580cdc3e55
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: Adrian Heine <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: Hoo man <[email protected]>
Gerrit-Reviewer: JanZerebecki <[email protected]>
Gerrit-Reviewer: Jonas Kress (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to