jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/326985 )
Change subject: Simplify $statement->getMainSnak()->getPropertyId() calls ...................................................................... Simplify $statement->getMainSnak()->getPropertyId() calls In preparation for T150788. Change-Id: I01f5bf607e00821f59022be4a473a666ed064261 --- M repo/includes/Api/SetClaimValue.php M repo/includes/ChangeOp/ChangeOpMainSnak.php M repo/includes/ChangeOp/ChangeOpStatement.php M repo/includes/ParserOutput/GeoDataDataUpdater.php M view/src/StatementGroupListView.php 5 files changed, 6 insertions(+), 6 deletions(-) Approvals: Hoo man: Looks good to me, approved jenkins-bot: Verified diff --git a/repo/includes/Api/SetClaimValue.php b/repo/includes/Api/SetClaimValue.php index b9f2362..dd1cc1a 100644 --- a/repo/includes/Api/SetClaimValue.php +++ b/repo/includes/Api/SetClaimValue.php @@ -93,7 +93,7 @@ $claim = $this->modificationHelper->getStatementFromEntity( $guid, $entity ); - $snak = $this->modificationHelper->getSnakInstance( $params, $claim->getMainSnak()->getPropertyId() ); + $snak = $this->modificationHelper->getSnakInstance( $params, $claim->getPropertyId() ); $summary = $this->modificationHelper->createSummary( $params, $this ); diff --git a/repo/includes/ChangeOp/ChangeOpMainSnak.php b/repo/includes/ChangeOp/ChangeOpMainSnak.php index 94b353d..8238c48 100644 --- a/repo/includes/ChangeOp/ChangeOpMainSnak.php +++ b/repo/includes/ChangeOp/ChangeOpMainSnak.php @@ -123,7 +123,7 @@ throw new ChangeOpException( "Entity does not have a statement with GUID " . $this->statementGuid ); } - $propertyId = $statement->getMainSnak()->getPropertyId(); + $propertyId = $statement->getPropertyId(); if ( !$propertyId->equals( $this->snak->getPropertyId() ) ) { throw new ChangeOpException( "Claim with GUID " diff --git a/repo/includes/ChangeOp/ChangeOpStatement.php b/repo/includes/ChangeOp/ChangeOpStatement.php index abb7019..63c98ee 100644 --- a/repo/includes/ChangeOp/ChangeOpStatement.php +++ b/repo/includes/ChangeOp/ChangeOpStatement.php @@ -183,7 +183,7 @@ */ private function checkMainSnakUpdate( Statement $oldStatement ) { $newMainSnak = $this->statement->getMainSnak(); - $oldPropertyId = $oldStatement->getMainSnak()->getPropertyId(); + $oldPropertyId = $oldStatement->getPropertyId(); if ( !$oldPropertyId->equals( $newMainSnak->getPropertyId() ) ) { $guid = $this->statement->getGuid(); diff --git a/repo/includes/ParserOutput/GeoDataDataUpdater.php b/repo/includes/ParserOutput/GeoDataDataUpdater.php index 341ba24..33908b9 100644 --- a/repo/includes/ParserOutput/GeoDataDataUpdater.php +++ b/repo/includes/ParserOutput/GeoDataDataUpdater.php @@ -77,7 +77,7 @@ * @param Statement $statement */ public function processStatement( Statement $statement ) { - $propertyId = $statement->getMainSnak()->getPropertyId(); + $propertyId = $statement->getPropertyId(); if ( $this->propertyDataTypeMatcher->isMatchingDataType( $propertyId, diff --git a/view/src/StatementGroupListView.php b/view/src/StatementGroupListView.php index fbb87a4..e9e5235 100644 --- a/view/src/StatementGroupListView.php +++ b/view/src/StatementGroupListView.php @@ -86,7 +86,7 @@ $byProperty = array(); foreach ( $statements as $statement ) { - $propertyId = $statement->getMainSnak()->getPropertyId(); + $propertyId = $statement->getPropertyId(); $byProperty[$propertyId->getSerialization()][] = $statement; } @@ -99,7 +99,7 @@ * @return string HTML */ private function getHtmlForStatementGroupView( array $statements ) { - $propertyId = $statements[0]->getMainSnak()->getPropertyId(); + $propertyId = $statements[0]->getPropertyId(); $addStatementHtml = $this->editSectionGenerator->getAddStatementToGroupSection( $propertyId ); return $this->templateFactory->render( -- To view, visit https://gerrit.wikimedia.org/r/326985 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I01f5bf607e00821f59022be4a473a666ed064261 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.de> Gerrit-Reviewer: Aleksey Bekh-Ivanov (WMDE) <aleksey.bekh-iva...@wikimedia.de> Gerrit-Reviewer: Hoo man <h...@online.de> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits