jenkins-bot has submitted this change and it was merged. Change subject: Fix specialpage type hints ......................................................................
Fix specialpage type hints Change-Id: I380e7beae6f69752471b76a3ba736ae3b5920a22 --- M constraint-report/specials/SpecialConstraintReport.php M constraint-report/tests/phpunit/Specials/SpecialConstraintReportTest.php M external-validation/specials/SpecialCrossCheck.php M specials/SpecialCheckResultPage.php 4 files changed, 16 insertions(+), 9 deletions(-) Approvals: Soeren.oldag: Checked; Looks good to me, approved jenkins-bot: Verified diff --git a/constraint-report/specials/SpecialConstraintReport.php b/constraint-report/specials/SpecialConstraintReport.php index eb89a83..a98b32f 100644 --- a/constraint-report/specials/SpecialConstraintReport.php +++ b/constraint-report/specials/SpecialConstraintReport.php @@ -109,7 +109,7 @@ * @see SpecialCheckResultPage::buildResultTable * * @param EntityId - * @param \Traversable $results + * @param array|Traversable $results * * @return string */ diff --git a/constraint-report/tests/phpunit/Specials/SpecialConstraintReportTest.php b/constraint-report/tests/phpunit/Specials/SpecialConstraintReportTest.php index 39e3e13..6e38e17 100755 --- a/constraint-report/tests/phpunit/Specials/SpecialConstraintReportTest.php +++ b/constraint-report/tests/phpunit/Specials/SpecialConstraintReportTest.php @@ -29,6 +29,10 @@ * @uses WikidataQuality\Html\HtmlTableCell * @uses WikidataQuality\Html\HtmlTableHeader * @uses WikidataQuality\Html\HtmlTableCell + * @uses WikidataQuality\Result\ResultToViolationTranslator + * @uses WikidataQuality\ConstraintReport\ConstraintCheck\Result\CheckResultToViolationTranslator + * @uses WikidataQuality\Violations\Violation + * @uses WikidataQuality\Violations\ViolationStore * * @author BP2014N1 * @license GNU GPL v2+ diff --git a/external-validation/specials/SpecialCrossCheck.php b/external-validation/specials/SpecialCrossCheck.php index cf9c3e4..a1877d5 100644 --- a/external-validation/specials/SpecialCrossCheck.php +++ b/external-validation/specials/SpecialCrossCheck.php @@ -70,11 +70,11 @@ * @see SpecialCheckResultPage::buildResultTable * * @param EntityId $entityId - * @param Traversable $results + * @param array|Traversable $results * * @return string */ - protected function buildResultTable( EntityId $entityId, Traversable $results ) { + protected function buildResultTable( EntityId $entityId, $results ) { $table = new HtmlTable( array ( new HtmlTableHeader( diff --git a/specials/SpecialCheckResultPage.php b/specials/SpecialCheckResultPage.php index db7ad75..a76c965 100644 --- a/specials/SpecialCheckResultPage.php +++ b/specials/SpecialCheckResultPage.php @@ -59,11 +59,11 @@ * Builds result table of given results * * @param EntityId $entityId - * @param Traversable $results + * @param array|Traversable $results * * @return string */ - protected abstract function buildResultTable( EntityId $entityId, Traversable $results ); + protected abstract function buildResultTable( EntityId $entityId, $results ); /** * Returns mapping of specific statuses to generic statuses used in css @@ -228,11 +228,11 @@ /** * Builds summary from given results * - * @param array $results + * @param array|Traversable $results * * @return string */ - protected function buildSummary( array $results ) { + protected function buildSummary( $results ) { $statuses = array (); foreach ( $results as $result ) { $status = strtolower( $result->getStatus() ); @@ -270,8 +270,11 @@ * @return string */ protected function buildTooltipElement( $content, $tooltipContent ) { - if (!is_string( $content || !is_string( $tooltipContent ) )) { - throw new InvalidArgumentException( 'Input of SpecialCheckResultPage::buildTooltipElement has to be string.' ); + if (!is_string( $content ) ) { + throw new InvalidArgumentException( '$content has to be string.' ); + } + if ( $tooltipContent && ( !is_string( $tooltipContent ) ) ) { + throw new InvalidArgumentException( '$tooltipContent, if provided, has to be string.' ); } if ( empty( $tooltipContent ) ) { -- To view, visit https://gerrit.wikimedia.org/r/204493 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I380e7beae6f69752471b76a3ba736ae3b5920a22 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikidataQuality Gerrit-Branch: master Gerrit-Owner: Tamslo <tamaraslosa...@gmail.com> Gerrit-Reviewer: Soeren.oldag <soeren_ol...@freenet.de> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits