From cff7dac346df3baf88cf3004f81011f09d43fed4 Mon Sep 17 00:00:00 2001 From: Fomafix Date: Wed, 30 Jan 2019 21:24:06 +0100 Subject: [PATCH] Fix @param tags * Use 'callable' instead of 'callback'. * Remove '$' as part of a type name. * Add missing type. Change-Id: Ic1b39a7d8cbbee000d8fb2f3a1f71a621bd01993 --- includes/http/GuzzleHttpRequest.php | 2 +- includes/http/MWHttpRequest.php | 2 +- tests/phpunit/includes/OutputPageTest.php | 2 +- tests/phpunit/includes/Revision/MutableRevisionSlotsTest.php | 2 +- tests/phpunit/includes/Revision/RenderedRevisionTest.php | 4 ++-- tests/phpunit/includes/Revision/RevisionRendererTest.php | 4 ++-- tests/phpunit/includes/Revision/RevisionSlotsTest.php | 2 +- tests/phpunit/includes/Storage/DerivedPageDataUpdaterTest.php | 2 +- tests/phpunit/includes/Storage/PageUpdaterTest.php | 2 +- .../phpunit/includes/libs/rdbms/database/DatabaseSQLTest.php | 4 ++-- tests/phpunit/includes/media/SvgHandlerTest.php | 2 +- tests/phpunit/maintenance/categoryChangesAsRdfTest.php | 4 +++- 12 files changed, 17 insertions(+), 15 deletions(-) diff --git a/includes/http/GuzzleHttpRequest.php b/includes/http/GuzzleHttpRequest.php index ef7046724f..e6b289206a 100644 --- a/includes/http/GuzzleHttpRequest.php +++ b/includes/http/GuzzleHttpRequest.php @@ -95,7 +95,7 @@ class GuzzleHttpRequest extends MWHttpRequest { * If a sink is already specified, this does nothing. This causes the 'sink' constructor * option to override the 'callback' constructor option. * - * @param $callback|null $callback + * @param callable|null $callback * @throws InvalidArgumentException */ protected function doSetCallback( $callback ) { diff --git a/includes/http/MWHttpRequest.php b/includes/http/MWHttpRequest.php index 3b56f21614..065667d165 100644 --- a/includes/http/MWHttpRequest.php +++ b/includes/http/MWHttpRequest.php @@ -333,7 +333,7 @@ abstract class MWHttpRequest implements LoggerAwareInterface { * Worker function for setting callbacks. Calls can originate both internally and externally * via setCallback). Defaults to the internal read callback if $callback is null. * - * @param $callback|null $callback + * @param callable|null $callback * @throws InvalidArgumentException */ protected function doSetCallback( $callback ) { diff --git a/tests/phpunit/includes/OutputPageTest.php b/tests/phpunit/includes/OutputPageTest.php index 00a08a719d..7d40d8c873 100644 --- a/tests/phpunit/includes/OutputPageTest.php +++ b/tests/phpunit/includes/OutputPageTest.php @@ -912,7 +912,7 @@ class OutputPageTest extends MediaWikiTestCase { * @param array $args Array of form [ category name => sort key ] * @param array $fakeResults Array of form [ category name => value to return from mocked * LinkBatch ] - * @param callback $variantLinkCallback Callback to replace findVariantLink() call + * @param callable $variantLinkCallback Callback to replace findVariantLink() call * @param array $expectedNormal Expected return value of getCategoryLinks['normal'] * @param array $expectedHidden Expected return value of getCategoryLinks['hidden'] */ diff --git a/tests/phpunit/includes/Revision/MutableRevisionSlotsTest.php b/tests/phpunit/includes/Revision/MutableRevisionSlotsTest.php index 7279e64a6e..0e565e5133 100644 --- a/tests/phpunit/includes/Revision/MutableRevisionSlotsTest.php +++ b/tests/phpunit/includes/Revision/MutableRevisionSlotsTest.php @@ -31,7 +31,7 @@ class MutableRevisionSlotsTest extends RevisionSlotsTest { /** * @dataProvider provideConstructorFailue - * @param $slots + * @param array $slots * * @covers \MediaWiki\Revision\RevisionSlots::__construct * @covers \MediaWiki\Revision\RevisionSlots::setSlotsInternal diff --git a/tests/phpunit/includes/Revision/RenderedRevisionTest.php b/tests/phpunit/includes/Revision/RenderedRevisionTest.php index 43fccee194..96658678ba 100644 --- a/tests/phpunit/includes/Revision/RenderedRevisionTest.php +++ b/tests/phpunit/includes/Revision/RenderedRevisionTest.php @@ -78,8 +78,8 @@ class RenderedRevisionTest extends MediaWikiTestCase { } /** - * @param $articleId - * @param $revisionId + * @param int $articleId + * @param int $revisionId * @return Title */ private function getMockTitle( $articleId, $revisionId ) { diff --git a/tests/phpunit/includes/Revision/RevisionRendererTest.php b/tests/phpunit/includes/Revision/RevisionRendererTest.php index 59b5a2ce98..071ea68347 100644 --- a/tests/phpunit/includes/Revision/RevisionRendererTest.php +++ b/tests/phpunit/includes/Revision/RevisionRendererTest.php @@ -30,8 +30,8 @@ use WikitextContent; class RevisionRendererTest extends MediaWikiTestCase { /** - * @param $articleId - * @param $revisionId + * @param int $articleId + * @param int $revisionId * @return Title */ private function getMockTitle( $articleId, $revisionId ) { diff --git a/tests/phpunit/includes/Revision/RevisionSlotsTest.php b/tests/phpunit/includes/Revision/RevisionSlotsTest.php index d8e7d92b58..52593ecc42 100644 --- a/tests/phpunit/includes/Revision/RevisionSlotsTest.php +++ b/tests/phpunit/includes/Revision/RevisionSlotsTest.php @@ -31,7 +31,7 @@ class RevisionSlotsTest extends MediaWikiTestCase { /** * @dataProvider provideConstructorFailue - * @param $slots + * @param array $slots * * @covers \MediaWiki\Revision\RevisionSlots::__construct * @covers \MediaWiki\Revision\RevisionSlots::setSlotsInternal diff --git a/tests/phpunit/includes/Storage/DerivedPageDataUpdaterTest.php b/tests/phpunit/includes/Storage/DerivedPageDataUpdaterTest.php index 3339749377..92c6f62c62 100644 --- a/tests/phpunit/includes/Storage/DerivedPageDataUpdaterTest.php +++ b/tests/phpunit/includes/Storage/DerivedPageDataUpdaterTest.php @@ -76,7 +76,7 @@ class DerivedPageDataUpdaterTest extends MediaWikiTestCase { * Creates a revision in the database. * * @param WikiPage $page - * @param $summary + * @param string|Message|CommentStoreComment $summary * @param null|string|Content $content * * @return RevisionRecord|null diff --git a/tests/phpunit/includes/Storage/PageUpdaterTest.php b/tests/phpunit/includes/Storage/PageUpdaterTest.php index 89e1d4ee1f..9d60605917 100644 --- a/tests/phpunit/includes/Storage/PageUpdaterTest.php +++ b/tests/phpunit/includes/Storage/PageUpdaterTest.php @@ -241,7 +241,7 @@ class PageUpdaterTest extends MediaWikiTestCase { * Creates a revision in the database. * * @param WikiPage $page - * @param $summary + * @param string|Message|CommentStoreComment $summary * @param null|string|Content $content * * @return RevisionRecord|null diff --git a/tests/phpunit/includes/libs/rdbms/database/DatabaseSQLTest.php b/tests/phpunit/includes/libs/rdbms/database/DatabaseSQLTest.php index d1d1aa3338..d73983955e 100644 --- a/tests/phpunit/includes/libs/rdbms/database/DatabaseSQLTest.php +++ b/tests/phpunit/includes/libs/rdbms/database/DatabaseSQLTest.php @@ -311,8 +311,8 @@ class DatabaseSQLTest extends PHPUnit\Framework\TestCase { /** * @covers Wikimedia\Rdbms\Subquery * @dataProvider provideSelectRowCount - * @param $sql - * @param $sqlText + * @param array $sql + * @param string $sqlText */ public function testSelectRowCount( $sql, $sqlText ) { $this->database->selectRowCount( diff --git a/tests/phpunit/includes/media/SvgHandlerTest.php b/tests/phpunit/includes/media/SvgHandlerTest.php index 9c98ada43b..bce7ac2684 100644 --- a/tests/phpunit/includes/media/SvgHandlerTest.php +++ b/tests/phpunit/includes/media/SvgHandlerTest.php @@ -182,7 +182,7 @@ class SvgHandlerTest extends MediaWikiMediaTestCase { * @covers SvgHandler::normaliseParamsInternal() * @dataProvider provideNormaliseParamsInternal * - * @param $message + * @param string $message * @param int $width * @param int $height * @param array $params diff --git a/tests/phpunit/maintenance/categoryChangesAsRdfTest.php b/tests/phpunit/maintenance/categoryChangesAsRdfTest.php index 22806299ac..f5a47d5101 100644 --- a/tests/phpunit/maintenance/categoryChangesAsRdfTest.php +++ b/tests/phpunit/maintenance/categoryChangesAsRdfTest.php @@ -1,5 +1,7 @@