Thiemo Mättig (WMDE) has uploaded a new change for review. https://gerrit.wikimedia.org/r/177214
Change subject: Remove redundant variable names from @return tags ...................................................................... Remove redundant variable names from @return tags Reason to touch these files are the @return tags. I also made stuff private in the files I touched. Change-Id: I679384b7f20b37759d087356258a762f0dc7bfc1 --- M client/includes/scribunto/WikibaseLuaBindings.php M lib/includes/serializers/LabelSerializer.php M repo/includes/ClaimSummaryBuilder.php M repo/includes/api/RemoveQualifiers.php M repo/includes/api/RemoveReferences.php M repo/includes/content/EntityHandler.php 6 files changed, 22 insertions(+), 28 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/14/177214/1 diff --git a/client/includes/scribunto/WikibaseLuaBindings.php b/client/includes/scribunto/WikibaseLuaBindings.php index 028c91c..3ae0708 100644 --- a/client/includes/scribunto/WikibaseLuaBindings.php +++ b/client/includes/scribunto/WikibaseLuaBindings.php @@ -226,7 +226,7 @@ * * @param string $pageTitle * - * @return string|null $id + * @return string|null */ public function getEntityId( $pageTitle ) { $id = $this->siteLinkTable->getItemIdForLink( $this->siteId, $pageTitle ); diff --git a/lib/includes/serializers/LabelSerializer.php b/lib/includes/serializers/LabelSerializer.php index 8f9e20a..299a8b7 100644 --- a/lib/includes/serializers/LabelSerializer.php +++ b/lib/includes/serializers/LabelSerializer.php @@ -89,10 +89,10 @@ * * @since 0.5 * - * @param array $data + * @param array[] $data * * @throws InvalidArgumentException - * @return array $labels + * @return string[] */ public function newFromSerialization( array $data ) { $labels = array(); @@ -114,4 +114,5 @@ return $labels; } + } diff --git a/repo/includes/ClaimSummaryBuilder.php b/repo/includes/ClaimSummaryBuilder.php index 8254cab..cd5bfd6 100644 --- a/repo/includes/ClaimSummaryBuilder.php +++ b/repo/includes/ClaimSummaryBuilder.php @@ -55,7 +55,7 @@ * @param Claims $existingClaims * @param Claim $newClaim * - * @return Summary $summary + * @return Summary */ public function buildClaimSummary( Claims $existingClaims, Claim $newClaim ) { $summary = new Summary( $this->apiModuleName ); @@ -109,7 +109,7 @@ * * @return array[] Associative array that contains property ID => array of main Snaks */ - protected function buildSummaryArgs( Claims $claims, array $guids ) { + private function buildSummaryArgs( Claims $claims, array $guids ) { $pairs = array(); foreach( $guids as $guid ) { diff --git a/repo/includes/api/RemoveQualifiers.php b/repo/includes/api/RemoveQualifiers.php index 4492b2e..b08391e 100644 --- a/repo/includes/api/RemoveQualifiers.php +++ b/repo/includes/api/RemoveQualifiers.php @@ -25,7 +25,7 @@ /** * @var ClaimChangeOpFactory */ - protected $claimChangeOpFactory; + private $claimChangeOpFactory; /** * @param ApiMain $mainModule @@ -78,10 +78,8 @@ /** * Check the provided parameters - * - * @since 0.4 */ - protected function validateParameters( array $params ) { + private function validateParameters( array $params ) { if ( !( $this->claimModificationHelper->validateClaimGuid( $params['claim'] ) ) ) { $this->dieError( 'Invalid claim guid' , 'invalid-guid' ); } @@ -91,11 +89,11 @@ * @since 0.4 * * @param string $claimGuid - * @param array $qualifierHashes + * @param string[] $qualifierHashes * - * @return ChangeOp[] $changeOps + * @return ChangeOp[] */ - protected function getChangeOps( $claimGuid, array $qualifierHashes ) { + private function getChangeOps( $claimGuid, array $qualifierHashes ) { $changeOps = array(); foreach ( $qualifierHashes as $qualifierHash ) { @@ -106,14 +104,12 @@ } /** - * @since 0.4 - * * @param array $params * @param Claim $claim * * @return string[] */ - protected function getQualifierHashesFromParams( array $params, Claim $claim ) { + private function getQualifierHashesFromParams( array $params, Claim $claim ) { $qualifiers = $claim->getQualifiers(); $hashes = array(); @@ -194,4 +190,5 @@ 'Remove qualifier with hash "1eb8793c002b1d9820c833d234a1b54c8e94187e" from claim with GUID of "Q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F"', ); } + } diff --git a/repo/includes/api/RemoveReferences.php b/repo/includes/api/RemoveReferences.php index b0b1551..33a579d 100644 --- a/repo/includes/api/RemoveReferences.php +++ b/repo/includes/api/RemoveReferences.php @@ -25,7 +25,7 @@ /** * @var StatementChangeOpFactory */ - protected $statementChangeOpFactory; + private $statementChangeOpFactory; /** * @param ApiMain $mainModule @@ -82,10 +82,8 @@ /** * Check the provided parameters - * - * @since 0.4 */ - protected function validateParameters( array $params ) { + private function validateParameters( array $params ) { if ( !( $this->claimModificationHelper->validateClaimGuid( $params['statement'] ) ) ) { $this->dieError( 'Invalid claim guid' , 'invalid-guid' ); } @@ -95,11 +93,11 @@ * @since 0.4 * * @param string $claimGuid - * @param array $referenceHashes + * @param string[] $referenceHashes * - * @return ChangeOp[] $changeOps + * @return ChangeOp[] */ - protected function getChangeOps( $claimGuid, array $referenceHashes ) { + private function getChangeOps( $claimGuid, array $referenceHashes ) { $changeOps = array(); foreach ( $referenceHashes as $referenceHash ) { @@ -110,14 +108,12 @@ } /** - * @since 0.4 - * * @param array $params * @param Statement $statement * * @return string[] */ - protected function getReferenceHashesFromParams( array $params, Statement $statement ) { + private function getReferenceHashesFromParams( array $params, Statement $statement ) { $references = $statement->getReferences(); $hashes = array(); @@ -197,4 +193,5 @@ 'api.php?action=wbremovereferences&statement=Q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F&references=455481eeac76e6a8af71a6b493c073d54788e7e9&token=foobar&baserevid=7201010' => 'Remove reference with hash "455481eeac76e6a8af71a6b493c073d54788e7e9" from claim with GUID of "Q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F"', ); } + } diff --git a/repo/includes/content/EntityHandler.php b/repo/includes/content/EntityHandler.php index 6e89e67..3bb2c61 100644 --- a/repo/includes/content/EntityHandler.php +++ b/repo/includes/content/EntityHandler.php @@ -425,7 +425,7 @@ * @param EntityId $id * * @throws InvalidArgumentException if $id refers to an entity of the wrong type. - * @return Title $target + * @return Title */ public function getTitleForId( EntityId $id ) { if ( $id->getEntityType() !== $this->getEntityType() ) { @@ -433,8 +433,7 @@ . $this->getEntityType() ); } - $title = Title::makeTitle( $this->getEntityNamespace(), $id->getSerialization() ); - return $title; + return Title::makeTitle( $this->getEntityNamespace(), $id->getSerialization() ); } /** -- To view, visit https://gerrit.wikimedia.org/r/177214 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I679384b7f20b37759d087356258a762f0dc7bfc1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits