jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/367386 )
Change subject: Remove DelegatingConstraintChecker::statements member
......................................................................
Remove DelegatingConstraintChecker::statements member
There’s no need to hold the statements in a member variable when they’re
only used in a single method, which could just take them as a parameter,
but even that’s not necessary since it can extract them from a parameter
it already takes.
Change-Id: I5eed1e42e7bc0c5d95f075543af1051b2ea76442
---
M includes/ConstraintCheck/DelegatingConstraintChecker.php
1 file changed, 1 insertion(+), 11 deletions(-)
Approvals:
Jonas Kress (WMDE): Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/ConstraintCheck/DelegatingConstraintChecker.php
b/includes/ConstraintCheck/DelegatingConstraintChecker.php
index 5098895..c50333f 100644
--- a/includes/ConstraintCheck/DelegatingConstraintChecker.php
+++ b/includes/ConstraintCheck/DelegatingConstraintChecker.php
@@ -43,13 +43,6 @@
private $checkerMap;
/**
- * List of all statements of given entity.
- *
- * @var StatementList
- */
- private $statements;
-
- /**
* @var ConstraintLookup
*/
private $constraintLookup;
@@ -96,8 +89,6 @@
*/
public function checkAgainstConstraints( EntityDocument $entity = null
) {
if ( $entity instanceof StatementListProvider ) {
- $this->statements = $entity->getStatements();
-
$result = $this->checkEveryStatement( $entity );
return $this->sortResult( $result );
@@ -120,7 +111,6 @@
$entity = $this->entityLookup->getEntity( $entityId );
if ( $entity instanceof StatementListProvider ) {
- $this->statements = $entity->getStatements();
$result = $this->checkEveryStatement(
$this->entityLookup->getEntity( $entityId ), $constraintIds );
$output = $this->sortResult( $result );
return $output;
@@ -215,7 +205,7 @@
$result = [];
/** @var Statement $statement */
- foreach ( $this->statements as $statement ) {
+ foreach ( $entity->getStatements() as $statement ) {
$result = array_merge( $result, $this->checkStatement(
$entity, $statement, $constraintIds ) );
}
--
To view, visit https://gerrit.wikimedia.org/r/367386
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I5eed1e42e7bc0c5d95f075543af1051b2ea76442
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints
Gerrit-Branch: master
Gerrit-Owner: Lucas Werkmeister (WMDE) <[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