Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405868 )

Change subject: Improve type hints in Checkers and remove redundant PHPDoc
......................................................................

Improve type hints in Checkers and remove redundant PHPDoc

The majority of this patch removes PHPDoc blocks that repeat 100%
exactly what the method header already states. But this is only minor
cleanup and not the meat of this patch.

Please also review Ie157941, which does the same in the
WikibaseQualityExternalValidation extension.

Change-Id: I7408a465e7750f0ecf4c2bb30d380a7943aecb34
---
M src/ConstraintCheck/Checker/CommonsLinkChecker.php
M src/ConstraintCheck/Checker/ConflictsWithChecker.php
M src/ConstraintCheck/Checker/DiffWithinRangeChecker.php
M src/ConstraintCheck/Checker/InverseChecker.php
M src/ConstraintCheck/Checker/ItemChecker.php
M src/ConstraintCheck/Checker/OneOfChecker.php
M src/ConstraintCheck/Checker/RangeChecker.php
M src/ConstraintCheck/Checker/SymmetricChecker.php
M src/ConstraintCheck/Checker/TargetRequiredClaimChecker.php
M src/ConstraintCheck/Checker/TypeChecker.php
M src/ConstraintCheck/Checker/ValueTypeChecker.php
M src/ConstraintCheck/Context/AbstractContext.php
M src/ConstraintCheck/Context/MainSnakContext.php
M src/ConstraintCheck/DelegatingConstraintChecker.php
M src/Specials/SpecialConstraintReport.php
15 files changed, 9 insertions(+), 94 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityConstraints
 refs/changes/68/405868/1

diff --git a/src/ConstraintCheck/Checker/CommonsLinkChecker.php 
b/src/ConstraintCheck/Checker/CommonsLinkChecker.php
index 928e257..64a84bd 100644
--- a/src/ConstraintCheck/Checker/CommonsLinkChecker.php
+++ b/src/ConstraintCheck/Checker/CommonsLinkChecker.php
@@ -36,11 +36,6 @@
         */
        private $titleParser;
 
-       /**
-        * @param ConstraintParameterParser $constraintParameterParser
-        * @param ConstraintParameterRenderer $constraintParameterRenderer
-        * @param TitleParser $titleParser
-        */
        public function __construct(
                ConstraintParameterParser $constraintParameterParser,
                ConstraintParameterRenderer $constraintParameterRenderer,
diff --git a/src/ConstraintCheck/Checker/ConflictsWithChecker.php 
b/src/ConstraintCheck/Checker/ConflictsWithChecker.php
index 8035d09..10380d8 100644
--- a/src/ConstraintCheck/Checker/ConflictsWithChecker.php
+++ b/src/ConstraintCheck/Checker/ConflictsWithChecker.php
@@ -41,12 +41,6 @@
         */
        private $constraintParameterRenderer;
 
-       /**
-        * @param EntityLookup $lookup
-        * @param ConstraintParameterParser $constraintParameterParser
-        * @param ConnectionCheckerHelper $connectionCheckerHelper
-        * @param ConstraintParameterRenderer $constraintParameterRenderer
-        */
        public function __construct(
                EntityLookup $lookup,
                ConstraintParameterParser $constraintParameterParser,
diff --git a/src/ConstraintCheck/Checker/DiffWithinRangeChecker.php 
b/src/ConstraintCheck/Checker/DiffWithinRangeChecker.php
index f516bbd..1e7af11 100644
--- a/src/ConstraintCheck/Checker/DiffWithinRangeChecker.php
+++ b/src/ConstraintCheck/Checker/DiffWithinRangeChecker.php
@@ -43,12 +43,6 @@
         */
        private $config;
 
-       /**
-        * @param ConstraintParameterParser $constraintParameterParser
-        * @param RangeCheckerHelper $rangeCheckerHelper
-        * @param ConstraintParameterRenderer $constraintParameterRenderer
-        * @param Config $config
-        */
        public function __construct(
                ConstraintParameterParser $constraintParameterParser,
                RangeCheckerHelper $rangeCheckerHelper,
diff --git a/src/ConstraintCheck/Checker/InverseChecker.php 
b/src/ConstraintCheck/Checker/InverseChecker.php
index b600fc2..a54258d 100644
--- a/src/ConstraintCheck/Checker/InverseChecker.php
+++ b/src/ConstraintCheck/Checker/InverseChecker.php
@@ -44,12 +44,6 @@
         */
        private $constraintParameterRenderer;
 
-       /**
-        * @param EntityLookup $lookup
-        * @param ConstraintParameterParser $constraintParameterParser
-        * @param ConnectionCheckerHelper $connectionCheckerHelper
-        * @param ConstraintParameterRenderer $constraintParameterRenderer
-        */
        public function __construct(
                EntityLookup $lookup,
                ConstraintParameterParser $constraintParameterParser,
diff --git a/src/ConstraintCheck/Checker/ItemChecker.php 
b/src/ConstraintCheck/Checker/ItemChecker.php
index c085b87..cd38685 100644
--- a/src/ConstraintCheck/Checker/ItemChecker.php
+++ b/src/ConstraintCheck/Checker/ItemChecker.php
@@ -40,12 +40,6 @@
         */
        private $constraintParameterRenderer;
 
-       /**
-        * @param EntityLookup $lookup
-        * @param ConstraintParameterParser $constraintParameterParser
-        * @param ConnectionCheckerHelper $connectionCheckerHelper
-        * @param ConstraintParameterRenderer $constraintParameterRenderer
-        */
        public function __construct(
                EntityLookup $lookup,
                ConstraintParameterParser $constraintParameterParser,
diff --git a/src/ConstraintCheck/Checker/OneOfChecker.php 
b/src/ConstraintCheck/Checker/OneOfChecker.php
index deb358a..ce820e2 100644
--- a/src/ConstraintCheck/Checker/OneOfChecker.php
+++ b/src/ConstraintCheck/Checker/OneOfChecker.php
@@ -28,10 +28,6 @@
         */
        private $constraintParameterRenderer;
 
-       /**
-        * @param ConstraintParameterParser $constraintParameterParser
-        * @param ConstraintParameterRenderer $constraintParameterRenderer
-        */
        public function __construct(
                ConstraintParameterParser $constraintParameterParser,
                ConstraintParameterRenderer $constraintParameterRenderer
diff --git a/src/ConstraintCheck/Checker/RangeChecker.php 
b/src/ConstraintCheck/Checker/RangeChecker.php
index 07dd70b..c17b90d 100644
--- a/src/ConstraintCheck/Checker/RangeChecker.php
+++ b/src/ConstraintCheck/Checker/RangeChecker.php
@@ -41,12 +41,6 @@
         */
        private $constraintParameterRenderer;
 
-       /**
-        * @param PropertyDataTypeLookup $propertyDataTypeLookup
-        * @param ConstraintParameterParser $constraintParameterParser
-        * @param RangeCheckerHelper $rangeCheckerHelper
-        * @param ConstraintParameterRenderer $constraintParameterRenderer
-        */
        public function __construct(
                PropertyDataTypeLookup $propertyDataTypeLookup,
                ConstraintParameterParser $constraintParameterParser,
diff --git a/src/ConstraintCheck/Checker/SymmetricChecker.php 
b/src/ConstraintCheck/Checker/SymmetricChecker.php
index 9b796d5..5093750 100644
--- a/src/ConstraintCheck/Checker/SymmetricChecker.php
+++ b/src/ConstraintCheck/Checker/SymmetricChecker.php
@@ -37,11 +37,6 @@
         */
        private $constraintParameterRenderer;
 
-       /**
-        * @param EntityLookup $lookup
-        * @param ConnectionCheckerHelper $connectionCheckerHelper
-        * @param ConstraintParameterRenderer $constraintParameterRenderer
-        */
        public function __construct(
                EntityLookup $lookup,
                ConnectionCheckerHelper $connectionCheckerHelper,
diff --git a/src/ConstraintCheck/Checker/TargetRequiredClaimChecker.php 
b/src/ConstraintCheck/Checker/TargetRequiredClaimChecker.php
index 4da60e9..97d5e1f 100644
--- a/src/ConstraintCheck/Checker/TargetRequiredClaimChecker.php
+++ b/src/ConstraintCheck/Checker/TargetRequiredClaimChecker.php
@@ -44,12 +44,6 @@
         */
        private $constraintParameterRenderer;
 
-       /**
-        * @param EntityLookup $lookup
-        * @param ConstraintParameterParser $constraintParameterParser
-        * @param ConnectionCheckerHelper $connectionCheckerHelper
-        * @param ConstraintParameterRenderer $constraintParameterRenderer
-        */
        public function __construct(
                EntityLookup $lookup,
                ConstraintParameterParser $constraintParameterParser,
diff --git a/src/ConstraintCheck/Checker/TypeChecker.php 
b/src/ConstraintCheck/Checker/TypeChecker.php
index d405edf..3155e70 100644
--- a/src/ConstraintCheck/Checker/TypeChecker.php
+++ b/src/ConstraintCheck/Checker/TypeChecker.php
@@ -41,12 +41,6 @@
         */
        private $config;
 
-       /**
-        * @param EntityLookup $lookup
-        * @param ConstraintParameterParser $constraintParameterParser
-        * @param TypeCheckerHelper $typeCheckerHelper
-        * @param Config $config
-        */
        public function __construct(
                EntityLookup $lookup,
                ConstraintParameterParser $constraintParameterParser,
diff --git a/src/ConstraintCheck/Checker/ValueTypeChecker.php 
b/src/ConstraintCheck/Checker/ValueTypeChecker.php
index 5f0ad93..e58d122 100644
--- a/src/ConstraintCheck/Checker/ValueTypeChecker.php
+++ b/src/ConstraintCheck/Checker/ValueTypeChecker.php
@@ -51,13 +51,6 @@
         */
        private $config;
 
-       /**
-        * @param EntityLookup $lookup
-        * @param ConstraintParameterParser $constraintParameterParser
-        * @param ConstraintParameterRenderer $constraintParameterRenderer
-        * @param TypeCheckerHelper $typeCheckerHelper
-        * @param Config $config
-        */
        public function __construct(
                EntityLookup $lookup,
                ConstraintParameterParser $constraintParameterParser,
diff --git a/src/ConstraintCheck/Context/AbstractContext.php 
b/src/ConstraintCheck/Context/AbstractContext.php
index b37b3eb..8a5f092 100644
--- a/src/ConstraintCheck/Context/AbstractContext.php
+++ b/src/ConstraintCheck/Context/AbstractContext.php
@@ -23,10 +23,7 @@
         */
        protected $snak;
 
-       public function __construct(
-               EntityDocument $entity,
-               Snak $snak
-       ) {
+       public function __construct( EntityDocument $entity, Snak $snak ) {
                $this->entity = $entity;
                $this->snak = $snak;
        }
diff --git a/src/ConstraintCheck/Context/MainSnakContext.php 
b/src/ConstraintCheck/Context/MainSnakContext.php
index 2970753..ad5b9aa 100644
--- a/src/ConstraintCheck/Context/MainSnakContext.php
+++ b/src/ConstraintCheck/Context/MainSnakContext.php
@@ -17,15 +17,9 @@
         */
        private $statement;
 
-       /**
-        * @param EntityDocument $entity
-        * @param Statement $statement
-        */
-       public function __construct(
-               EntityDocument $entity,
-               Statement $statement
-       ) {
+       public function __construct( EntityDocument $entity, Statement 
$statement ) {
                parent::__construct( $entity, $statement->getMainSnak() );
+
                $this->statement = $statement;
        }
 
diff --git a/src/ConstraintCheck/DelegatingConstraintChecker.php 
b/src/ConstraintCheck/DelegatingConstraintChecker.php
index 9cd62cb..050b500 100644
--- a/src/ConstraintCheck/DelegatingConstraintChecker.php
+++ b/src/ConstraintCheck/DelegatingConstraintChecker.php
@@ -122,18 +122,17 @@
         * Statements of the entity will be checked against every constraint 
that is defined on the property.
         *
         * @param EntityId $entityId
-        * @param array $constraintIds
+        * @param string[]|null $constraintIds
         * @param callable|null $defaultResults Optional function to 
pre-populate the check results.
         * For each {@link Context} where constraints will be checked,
         * this function (if not null) is first called with that context as 
argument,
         * and may return an array of check results to which the regular 
results are appended.
         *
         * @return CheckResult[]
-        *
         */
        public function checkAgainstConstraintsOnEntityId(
                EntityId $entityId,
-               $constraintIds = null,
+               array $constraintIds = null,
                callable $defaultResults = null
        ) {
 
@@ -156,7 +155,7 @@
         * Statements of the entity will be checked against every constraint 
that is defined on the claim.
         *
         * @param string $guid
-        * @param array $constraintIds
+        * @param string[]|null $constraintIds
         * @param callable|null $defaultResults Optional function to 
pre-populate the check results.
         * For each {@link Context} where constraints will be checked,
         * this function (if not null) is first called with that context as 
argument,
@@ -166,7 +165,7 @@
         */
        public function checkAgainstConstraintsOnClaimId(
                $guid,
-               $constraintIds = null,
+               array $constraintIds = null,
                callable $defaultResults = null
        ) {
 
@@ -308,7 +307,7 @@
         */
        private function checkEveryStatement(
                EntityDocument $entity,
-               $constraintIds = null,
+               array $constraintIds = null,
                callable $defaultResults = null
        ) {
                $result = [];
@@ -338,7 +337,7 @@
        private function checkStatement(
                EntityDocument $entity,
                Statement $statement,
-               $constraintIds = null,
+               array $constraintIds = null,
                callable $defaultResults = null
        ) {
                $result = [];
diff --git a/src/Specials/SpecialConstraintReport.php 
b/src/Specials/SpecialConstraintReport.php
index bee8dac..f892672 100644
--- a/src/Specials/SpecialConstraintReport.php
+++ b/src/Specials/SpecialConstraintReport.php
@@ -115,18 +115,6 @@
                );
        }
 
-       /**
-        * @param EntityLookup $entityLookup
-        * @param EntityTitleLookup $entityTitleLookup
-        * @param EntityIdLabelFormatterFactory $entityIdLabelFormatterFactory
-        * @param EntityIdHtmlLinkFormatterFactory 
$entityIdHtmlLinkFormatterFactory
-        * @param LanguageFallbackLabelDescriptionLookupFactory 
$fallbackLabelDescLookupFactory
-        * @param EntityIdParser $entityIdParser
-        * @param OutputFormatValueFormatterFactory $valueFormatterFactory
-        * @param DelegatingConstraintChecker $constraintChecker
-        * @param Config $config
-        * @param IBufferingStatsdDataFactory $dataFactory
-        */
        public function __construct(
                EntityLookup $entityLookup,
                EntityTitleLookup $entityTitleLookup,

-- 
To view, visit https://gerrit.wikimedia.org/r/405868
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7408a465e7750f0ecf4c2bb30d380a7943aecb34
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) <thiemo.kr...@wikimedia.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to