Tamslo has uploaded a new change for review.
https://gerrit.wikimedia.org/r/204493
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(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikidataQuality
refs/changes/93/204493/1
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: newchange
Gerrit-Change-Id: I380e7beae6f69752471b76a3ba736ae3b5920a22
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikidataQuality
Gerrit-Branch: master
Gerrit-Owner: Tamslo <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits