Lucas Werkmeister (WMDE) has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/374567 )
Change subject: Remove DelegatingConstraintChecker::checkAgainstConstraints
......................................................................
Remove DelegatingConstraintChecker::checkAgainstConstraints
It’s a near-duplicate of checkAgainstConstraintsOnEntityId, there’s no
need to have both.
Change-Id: I14b0bc399567253be3dadb3eda6c681a142394ff
---
M includes/ConstraintCheck/DelegatingConstraintChecker.php
M specials/SpecialConstraintReport.php
2 files changed, 5 insertions(+), 34 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 55761de..b2ea7bb 100644
--- a/includes/ConstraintCheck/DelegatingConstraintChecker.php
+++ b/includes/ConstraintCheck/DelegatingConstraintChecker.php
@@ -90,24 +90,6 @@
}
/**
- * Starts the whole constraint-check process.
- * Statements of the entity will be checked against every constraint
that is defined on the property.
- *
- * @param EntityDocument|null $entity
- *
- * @return CheckResult[]|null
- */
- public function checkAgainstConstraints( EntityDocument $entity = null
) {
- if ( $entity instanceof StatementListProvider ) {
- $result = $this->checkEveryStatement( $entity );
-
- return $this->sortResult( $result );
- }
-
- return null;
- }
-
- /**
* Starts the whole constraint-check process for entity or constraint
ID on entity.
* Statements of the entity will be checked against every constraint
that is defined on the property.
*
diff --git a/specials/SpecialConstraintReport.php
b/specials/SpecialConstraintReport.php
index 67e03ea..96b4b43 100644
--- a/specials/SpecialConstraintReport.php
+++ b/specials/SpecialConstraintReport.php
@@ -225,7 +225,6 @@
try {
$entityId = $this->entityIdParser->parse( $subPage );
- $entity = $this->entityLookup->getEntity( $entityId );
} catch ( EntityIdParsingException $e ) {
$out->addHTML(
$this->buildNotice(
'wbqc-constraintreport-invalid-entity-id', true )
@@ -233,16 +232,18 @@
return;
}
- if ( !$entity ) {
+ if ( !$this->entityLookup->hasEntity( $entityId ) ) {
$out->addHTML(
$this->buildNotice(
'wbqc-constraintreport-not-existent-entity', true )
);
return;
}
- $results = $this->executeCheck( $entity );
+ MediaWikiServices::getInstance()->getStatsdDataFactory()
+ ->increment(
'wikibase.quality.constraints.specials.specialConstraintReport.executeCheck' );
+ $results =
$this->constraintChecker->checkAgainstConstraintsOnEntityId( $entityId );
- if ( $results && count( $results ) > 0 ) {
+ if ( count( $results ) > 0 ) {
$out->addHTML(
$this->buildResultHeader( $entityId )
. $this->buildSummary( $results )
@@ -329,18 +330,6 @@
$this->msg(
'wbqc-constraintreport-explanation-part-two' )->escaped()
)
);
- }
-
- /**
- * @param EntityDocument $entity
- *
- * @return CheckResult[]|null
- */
- private function executeCheck( EntityDocument $entity ) {
- MediaWikiServices::getInstance()->getStatsdDataFactory()
- ->increment(
'wikibase.quality.constraints.specials.specialConstraintReport.executeCheck' );
-
- return $this->constraintChecker->checkAgainstConstraints(
$entity );
}
/**
--
To view, visit https://gerrit.wikimedia.org/r/374567
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I14b0bc399567253be3dadb3eda6c681a142394ff
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints
Gerrit-Branch: master
Gerrit-Owner: Lucas Werkmeister (WMDE) <[email protected]>
Gerrit-Reviewer: Jonas Kress (WMDE) <[email protected]>
Gerrit-Reviewer: Lucas Werkmeister (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits