jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/328910 )
Change subject: Fix and add missing PHPDoc lines ...................................................................... Fix and add missing PHPDoc lines I also found a chunk of entirely unused code this way. Everything in this patch should be super trivial and obvious. If you disagree, then please tell me and I will split this patch into multiple ones. Change-Id: If6bd8bba2132d029812f31acbd3f427a93871c6e --- M client/includes/DispatchingServiceFactory.php M client/includes/Hooks/InterwikiSortingHookHandlers.php M client/includes/Notifications/PageConnectionPresentationModel.php M client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseEntityLibraryTest.php M client/tests/phpunit/includes/Hooks/EchoNotificationsHandlersTest.php M lib/includes/Store/PropertyInfoLookup.php M lib/includes/Store/Sql/SqlEntityInfoBuilder.php M repo/includes/Api/RemoveQualifiers.php M repo/includes/Api/SetAliases.php M repo/includes/Api/SetSiteLink.php M repo/includes/ChangeOp/ChangeOpAliases.php M repo/includes/ChangeOp/ChangeOpDescription.php M repo/includes/ChangeOp/ChangeOpMainSnak.php M repo/includes/ChangeOp/ChangeOpQualifier.php M repo/includes/ChangeOp/ChangeOpQualifierRemove.php M repo/includes/ChangeOp/ChangeOpReference.php M repo/includes/ChangeOp/ChangeOpReferenceRemove.php M repo/includes/ChangeOp/ChangeOpSiteLink.php M repo/includes/ChangeOp/ChangeOpStatementRank.php M repo/includes/MediaWikiLanguageDirectionalityLookup.php M repo/includes/Parsers/MwTimeIsoParser.php M repo/includes/Specials/SpecialNewProperty.php M repo/includes/Store/Sql/EntityPerPageTable.php M repo/tests/phpunit/includes/Specials/SpecialItemByTitleTest.php M view/resources/wikibase/view/ViewFactory.js 25 files changed, 89 insertions(+), 29 deletions(-) Approvals: Ladsgroup: Looks good to me, approved jenkins-bot: Verified diff --git a/client/includes/DispatchingServiceFactory.php b/client/includes/DispatchingServiceFactory.php index 59d857b..03d31cb 100644 --- a/client/includes/DispatchingServiceFactory.php +++ b/client/includes/DispatchingServiceFactory.php @@ -75,7 +75,11 @@ /** * Returns a map of id prefix mappings defined for configured foreign repositories. - * @return array Associative array mapping repository names to repository-specific prefix mapping + * + * @param array[] $settings + * + * @return array[] Associative array mapping repository names to repository-specific prefix + * mapping. */ private function getIdPrefixMaps( array $settings ) { $mappings = []; diff --git a/client/includes/Hooks/InterwikiSortingHookHandlers.php b/client/includes/Hooks/InterwikiSortingHookHandlers.php index a7319cf..c2736ad 100644 --- a/client/includes/Hooks/InterwikiSortingHookHandlers.php +++ b/client/includes/Hooks/InterwikiSortingHookHandlers.php @@ -36,7 +36,7 @@ private $alwaysSort; /** - * @return InterwikiSortingConfig + * @return self */ public static function newFromGlobalState() { $wikibaseClient = WikibaseClient::getDefaultInstance(); @@ -57,7 +57,7 @@ * @param Config $config * @param NamespaceChecker $namespaceChecker * - * @return InterwikiSortingHookHandlers + * @return self */ public static function newFromInterwikiSortingConfig( Config $config, @@ -69,7 +69,7 @@ $config->get( 'InterwikiSortingSortPrepend' ) ); - return new InterwikiSortingHookHandlers( + return new self( $interwikiSorter, $namespaceChecker, $config->get( 'InterwikiSortingAlwaysSort' ) @@ -80,7 +80,7 @@ * @param SettingsArray $settings * @param NamespaceChecker $namespaceChecker * - * @return InterwikiSortingHookHandlers + * @return self */ public static function newFromWikibaseConfig( SettingsArray $settings, @@ -92,7 +92,7 @@ $settings->getSetting( 'sortPrepend' ) ); - return new InterwikiSortingHookHandlers( + return new self( $interwikiSorter, $namespaceChecker, $settings->getSetting( 'alwaysSort' ) diff --git a/client/includes/Notifications/PageConnectionPresentationModel.php b/client/includes/Notifications/PageConnectionPresentationModel.php index bfa33dc..2d34b9a 100644 --- a/client/includes/Notifications/PageConnectionPresentationModel.php +++ b/client/includes/Notifications/PageConnectionPresentationModel.php @@ -18,7 +18,8 @@ class PageConnectionPresentationModel extends EchoEventPresentationModel { /** - * @param EchoEvent + * @param EchoEvent $event + * * @return string */ public function callbackForBundleCount( EchoEvent $event ) { diff --git a/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseEntityLibraryTest.php b/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseEntityLibraryTest.php index e85cfca..06bf2d3 100644 --- a/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseEntityLibraryTest.php +++ b/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseEntityLibraryTest.php @@ -232,7 +232,7 @@ * @param bool &$cacheSplit Will become true when the ParserCache has been split * @param Language|null $userLang The user's language * - * @return Scribunto_LuaWikibaseLibrary + * @return Scribunto_LuaWikibaseEntityLibrary */ private function newScribuntoLuaWikibaseLibrary( &$cacheSplit = false, Language $userLang = null ) { /* @var $engine Scribunto_LuaEngine */ diff --git a/client/tests/phpunit/includes/Hooks/EchoNotificationsHandlersTest.php b/client/tests/phpunit/includes/Hooks/EchoNotificationsHandlersTest.php index 729e370..df5633d 100644 --- a/client/tests/phpunit/includes/Hooks/EchoNotificationsHandlersTest.php +++ b/client/tests/phpunit/includes/Hooks/EchoNotificationsHandlersTest.php @@ -5,6 +5,7 @@ use EchoEvent; use MediaWikiTestCase; use Title; +use Wikibase\ChangeRow; use Wikibase\Client\Hooks\EchoNotificationsHandlers; use Wikibase\Client\RepoLinker; use Wikibase\Lib\Tests\Changes\TestChanges; diff --git a/lib/includes/Store/PropertyInfoLookup.php b/lib/includes/Store/PropertyInfoLookup.php index ce81897..79330fd 100644 --- a/lib/includes/Store/PropertyInfoLookup.php +++ b/lib/includes/Store/PropertyInfoLookup.php @@ -2,6 +2,7 @@ namespace Wikibase\Lib\Store; +use DBError; use Wikibase\DataModel\Entity\PropertyId; /** diff --git a/lib/includes/Store/Sql/SqlEntityInfoBuilder.php b/lib/includes/Store/Sql/SqlEntityInfoBuilder.php index 468d903..aef2797 100644 --- a/lib/includes/Store/Sql/SqlEntityInfoBuilder.php +++ b/lib/includes/Store/Sql/SqlEntityInfoBuilder.php @@ -512,6 +512,8 @@ /** * @see EntityInfoBuilder::removeMissing + * + * @param string $redirects A flag, either "keep-redirects" (default) or "remove-redirects". */ public function removeMissing( $redirects = 'keep-redirects' ) { $missingIds = $this->getMissingIds( $redirects !== 'keep-redirects' ); diff --git a/repo/includes/Api/RemoveQualifiers.php b/repo/includes/Api/RemoveQualifiers.php index f678d0c..9d9e51b 100644 --- a/repo/includes/Api/RemoveQualifiers.php +++ b/repo/includes/Api/RemoveQualifiers.php @@ -113,7 +113,9 @@ } /** - * Check the provided parameters + * @param array $params + * + * @throws ApiUsageException */ private function validateParameters( array $params ) { if ( !( $this->modificationHelper->validateStatementGuid( $params['claim'] ) ) ) { diff --git a/repo/includes/Api/SetAliases.php b/repo/includes/Api/SetAliases.php index 43f5062..07bf2bf 100644 --- a/repo/includes/Api/SetAliases.php +++ b/repo/includes/Api/SetAliases.php @@ -77,6 +77,10 @@ /** * @see ModifyEntity::validateParameters + * + * @param array $params + * + * @throws ApiUsageException */ protected function validateParameters( array $params ) { parent::validateParameters( $params ); diff --git a/repo/includes/Api/SetSiteLink.php b/repo/includes/Api/SetSiteLink.php index d475bcc..9b8b30d 100644 --- a/repo/includes/Api/SetSiteLink.php +++ b/repo/includes/Api/SetSiteLink.php @@ -79,23 +79,6 @@ } /** - * @see ModifyEntity::getEntityRevisionFromApiParams - */ - protected function getEntityRevisionFromApiParams( array $params ) { - $entityRev = parent::getEntityRevisionFromApiParams( $params ); - - // If we found anything then check if it is of the correct base class - if ( !is_null( $entityRev ) && !( $entityRev->getEntity() instanceof Item ) ) { - $this->errorReporter->dieError( - 'The content on the found page is not of correct type', - 'wrong-class' - ); - } - - return $entityRev; - } - - /** * @see ModifyEntity::modifyEntity */ protected function modifyEntity( EntityDocument &$entity, array $params, $baseRevId ) { diff --git a/repo/includes/ChangeOp/ChangeOpAliases.php b/repo/includes/ChangeOp/ChangeOpAliases.php index 993617a..bf64e17 100644 --- a/repo/includes/ChangeOp/ChangeOpAliases.php +++ b/repo/includes/ChangeOp/ChangeOpAliases.php @@ -100,6 +100,12 @@ /** * @see ChangeOp::apply() + * + * @param EntityDocument $entity + * @param Summary|null $summary + * + * @throws InvalidArgumentException + * @throws ChangeOpException */ public function apply( EntityDocument $entity, Summary $summary = null ) { if ( !( $entity instanceof AliasesProvider ) ) { diff --git a/repo/includes/ChangeOp/ChangeOpDescription.php b/repo/includes/ChangeOp/ChangeOpDescription.php index 5f0eae7..032e9f7 100644 --- a/repo/includes/ChangeOp/ChangeOpDescription.php +++ b/repo/includes/ChangeOp/ChangeOpDescription.php @@ -76,6 +76,12 @@ /** * @see ChangeOp::apply() + * + * @param EntityDocument $entity + * @param Summary|null $summary + * + * @throws InvalidArgumentException + * @throws ChangeOpException */ public function apply( EntityDocument $entity, Summary $summary = null ) { if ( !( $entity instanceof DescriptionsProvider ) ) { diff --git a/repo/includes/ChangeOp/ChangeOpMainSnak.php b/repo/includes/ChangeOp/ChangeOpMainSnak.php index 8238c48..8ca823d 100644 --- a/repo/includes/ChangeOp/ChangeOpMainSnak.php +++ b/repo/includes/ChangeOp/ChangeOpMainSnak.php @@ -84,6 +84,12 @@ * @see ChangeOp::apply() * - a new claim with $snak as mainsnak gets added when $claimGuid is empty and $snak is set * - the claim's mainsnak gets set to $snak when $claimGuid and $snak are set + * + * @param EntityDocument $entity + * @param Summary|null $summary + * + * @throws InvalidArgumentException + * @throws ChangeOpException */ public function apply( EntityDocument $entity, Summary $summary = null ) { if ( !( $entity instanceof StatementListProvider ) ) { diff --git a/repo/includes/ChangeOp/ChangeOpQualifier.php b/repo/includes/ChangeOp/ChangeOpQualifier.php index e8d809f..0d41bf7 100644 --- a/repo/includes/ChangeOp/ChangeOpQualifier.php +++ b/repo/includes/ChangeOp/ChangeOpQualifier.php @@ -73,6 +73,12 @@ * @see ChangeOp::apply() * - a new qualifier gets added when $snakHash is empty and $snak is set * - the qualifier gets set to $snak when $snakHash and $snak are set + * + * @param EntityDocument $entity + * @param Summary|null $summary + * + * @throws InvalidArgumentException + * @throws ChangeOpException */ public function apply( EntityDocument $entity, Summary $summary = null ) { if ( !( $entity instanceof StatementListProvider ) ) { diff --git a/repo/includes/ChangeOp/ChangeOpQualifierRemove.php b/repo/includes/ChangeOp/ChangeOpQualifierRemove.php index 492ad95..5618da4 100644 --- a/repo/includes/ChangeOp/ChangeOpQualifierRemove.php +++ b/repo/includes/ChangeOp/ChangeOpQualifierRemove.php @@ -55,6 +55,12 @@ /** * @see ChangeOp::apply() + * + * @param EntityDocument $entity + * @param Summary|null $summary + * + * @throws InvalidArgumentException + * @throws ChangeOpException */ public function apply( EntityDocument $entity, Summary $summary = null ) { if ( !( $entity instanceof StatementListProvider ) ) { diff --git a/repo/includes/ChangeOp/ChangeOpReference.php b/repo/includes/ChangeOp/ChangeOpReference.php index 7a2efbd..0affc78 100644 --- a/repo/includes/ChangeOp/ChangeOpReference.php +++ b/repo/includes/ChangeOp/ChangeOpReference.php @@ -95,6 +95,12 @@ * @see ChangeOp::apply() * - a new reference gets added when $referenceHash is empty and $reference is set * - the reference gets set to $reference when $referenceHash and $reference are set + * + * @param EntityDocument $entity + * @param Summary|null $summary + * + * @throws InvalidArgumentException + * @throws ChangeOpException */ public function apply( EntityDocument $entity, Summary $summary = null ) { if ( !( $entity instanceof StatementListProvider ) ) { diff --git a/repo/includes/ChangeOp/ChangeOpReferenceRemove.php b/repo/includes/ChangeOp/ChangeOpReferenceRemove.php index 288b7d7..647a614 100644 --- a/repo/includes/ChangeOp/ChangeOpReferenceRemove.php +++ b/repo/includes/ChangeOp/ChangeOpReferenceRemove.php @@ -55,6 +55,12 @@ /** * @see ChangeOp::apply() + * + * @param EntityDocument $entity + * @param Summary|null $summary + * + * @throws InvalidArgumentException + * @throws ChangeOpException */ public function apply( EntityDocument $entity, Summary $summary = null ) { if ( !( $entity instanceof StatementListProvider ) ) { diff --git a/repo/includes/ChangeOp/ChangeOpSiteLink.php b/repo/includes/ChangeOp/ChangeOpSiteLink.php index 340b7b7..2bc5dd4 100644 --- a/repo/includes/ChangeOp/ChangeOpSiteLink.php +++ b/repo/includes/ChangeOp/ChangeOpSiteLink.php @@ -129,6 +129,11 @@ /** * @see ChangeOp::apply + * + * @param EntityDocument $entity + * @param Summary|null $summary + * + * @throws InvalidArgumentException */ public function apply( EntityDocument $entity, Summary $summary = null ) { if ( !( $entity instanceof Item ) ) { diff --git a/repo/includes/ChangeOp/ChangeOpStatementRank.php b/repo/includes/ChangeOp/ChangeOpStatementRank.php index 6b02cb3..dff60d7 100644 --- a/repo/includes/ChangeOp/ChangeOpStatementRank.php +++ b/repo/includes/ChangeOp/ChangeOpStatementRank.php @@ -55,6 +55,12 @@ /** * @see ChangeOp::apply() + * + * @param EntityDocument $entity + * @param Summary|null $summary + * + * @throws InvalidArgumentException + * @throws ChangeOpException */ public function apply( EntityDocument $entity, Summary $summary = null ) { if ( !( $entity instanceof StatementListProvider ) ) { diff --git a/repo/includes/MediaWikiLanguageDirectionalityLookup.php b/repo/includes/MediaWikiLanguageDirectionalityLookup.php index cf582f8..fa74c75 100644 --- a/repo/includes/MediaWikiLanguageDirectionalityLookup.php +++ b/repo/includes/MediaWikiLanguageDirectionalityLookup.php @@ -18,6 +18,10 @@ /** * @see LanguageDirectionalityLookup::getDirectionality + * + * @param string $languageCode + * + * @return string|null 'ltr', 'rtl' or null if unknown */ public function getDirectionality( $languageCode ) { return Language::factory( $languageCode )->getDir(); diff --git a/repo/includes/Parsers/MwTimeIsoParser.php b/repo/includes/Parsers/MwTimeIsoParser.php index 04ace74..532d55a 100644 --- a/repo/includes/Parsers/MwTimeIsoParser.php +++ b/repo/includes/Parsers/MwTimeIsoParser.php @@ -77,6 +77,8 @@ /** * @see StringValueParser::__construct + * + * @param ParserOptions|null $options */ public function __construct( ParserOptions $options = null ) { parent::__construct( $options ); diff --git a/repo/includes/Specials/SpecialNewProperty.php b/repo/includes/Specials/SpecialNewProperty.php index 753ae35..713521c 100644 --- a/repo/includes/Specials/SpecialNewProperty.php +++ b/repo/includes/Specials/SpecialNewProperty.php @@ -53,6 +53,8 @@ } /** + * @param string $dataType + * * @return bool */ private function dataTypeExists( $dataType ) { diff --git a/repo/includes/Store/Sql/EntityPerPageTable.php b/repo/includes/Store/Sql/EntityPerPageTable.php index 4eecffc..39a2ad8 100644 --- a/repo/includes/Store/Sql/EntityPerPageTable.php +++ b/repo/includes/Store/Sql/EntityPerPageTable.php @@ -35,7 +35,6 @@ /** * @param LoadBalancer $loadBalancer * @param EntityIdParser $entityIdParser - * @param EntityIdComposer $entityIdComposer */ public function __construct( LoadBalancer $loadBalancer, diff --git a/repo/tests/phpunit/includes/Specials/SpecialItemByTitleTest.php b/repo/tests/phpunit/includes/Specials/SpecialItemByTitleTest.php index 4311aef..a1ba284 100644 --- a/repo/tests/phpunit/includes/Specials/SpecialItemByTitleTest.php +++ b/repo/tests/phpunit/includes/Specials/SpecialItemByTitleTest.php @@ -7,6 +7,7 @@ use SiteLookup; use SpecialPageTestBase; use Title; +use WebResponse; use Wikibase\DataModel\Entity\EntityId; use Wikibase\DataModel\Entity\ItemId; use Wikibase\Lib\LanguageNameLookup; @@ -187,13 +188,13 @@ * @dataProvider requestProvider */ public function testExecute( $sub, $target, array $matchers ) { - /* @var FauxResponse $response */ + /* @var WebResponse $response */ list( $output, $response ) = $this->executeSpecialPage( $sub ); if ( $target !== null ) { $target = Title::newFromText( $target )->getFullURL(); $expected = wfExpandUrl( $target, PROTO_CURRENT ); - $this->assertEquals( $expected, $response->getheader( 'Location' ), 'Redirect' ); + $this->assertEquals( $expected, $response->getHeader( 'Location' ), 'Redirect' ); } foreach ( $matchers as $key => $matcher ) { diff --git a/view/resources/wikibase/view/ViewFactory.js b/view/resources/wikibase/view/ViewFactory.js index f5cd926..d468412 100644 --- a/view/resources/wikibase/view/ViewFactory.js +++ b/view/resources/wikibase/view/ViewFactory.js @@ -577,6 +577,7 @@ * @param {Object} options An object with keys `locked` and `autoStartEditing` * @param {wikibase.datamodel.Snak|null} snak * @param {jQuery} $snakview + * @param {Function} removeCallback * @return {jQuery.wikibase.snakview} The constructed snakview */ SELF.prototype.getSnakView = function( startEditingCallback, drawProperty, options, snak, $snakview, removeCallback ) { -- To view, visit https://gerrit.wikimedia.org/r/328910 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If6bd8bba2132d029812f31acbd3f427a93871c6e Gerrit-PatchSet: 3 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: Aleksey Bekh-Ivanov (WMDE) <aleksey.bekh-iva...@wikimedia.de> Gerrit-Reviewer: Aude <aude.w...@gmail.com> Gerrit-Reviewer: Hoo man <h...@online.de> Gerrit-Reviewer: Ladsgroup <ladsgr...@gmail.com> Gerrit-Reviewer: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.de> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits