jenkins-bot has submitted this change and it was merged.
Change subject: Add array type hints to public methods
......................................................................
Add array type hints to public methods
Jonas and I double checked all usages.
Change-Id: I950bffd2a52da7f690d73a795ce4a2a62fb9494d
---
M client/WikibaseClient.hooks.php
M client/includes/DataAccess/SnaksFinder.php
M client/includes/DataAccess/StatementTransclusionInteractor.php
M client/includes/Hooks/SpecialWatchlistQueryHandler.php
M client/includes/RepoLinker.php
M repo/includes/ChangeOp/SiteLinkChangeOpFactory.php
M repo/includes/Interactors/ItemMergeInteractor.php
M view/src/Template/Template.php
8 files changed, 15 insertions(+), 11 deletions(-)
Approvals:
Jeroen De Dauw: Looks good to me, approved
jenkins-bot: Verified
diff --git a/client/WikibaseClient.hooks.php b/client/WikibaseClient.hooks.php
index bfe7ca1..0de0d8e 100644
--- a/client/WikibaseClient.hooks.php
+++ b/client/WikibaseClient.hooks.php
@@ -186,7 +186,7 @@
* @param array &$tables
* @param array &$join_conds
* @param array &$fields
- * @param FormOptions|null $opts
+ * @param FormOptions|array|null $opts MediaWiki 1.22 used an array and
MobileFrontend still does.
*
* @return bool
*/
diff --git a/client/includes/DataAccess/SnaksFinder.php
b/client/includes/DataAccess/SnaksFinder.php
index eabdae1..86dc1f3 100644
--- a/client/includes/DataAccess/SnaksFinder.php
+++ b/client/includes/DataAccess/SnaksFinder.php
@@ -24,7 +24,11 @@
*
* @return Snak[]
*/
- public function findSnaks( StatementListProvider
$statementListProvider, PropertyId $propertyId, $acceptableRanks = null ) {
+ public function findSnaks(
+ StatementListProvider $statementListProvider,
+ PropertyId $propertyId,
+ array $acceptableRanks = null
+ ) {
$statementList = $this->getStatementsWithPropertyId(
$statementListProvider, $propertyId );
if ( $acceptableRanks === null ) {
return
$statementList->getBestStatements()->getMainSnaks();
diff --git a/client/includes/DataAccess/StatementTransclusionInteractor.php
b/client/includes/DataAccess/StatementTransclusionInteractor.php
index 3c94199..6fe8037 100644
--- a/client/includes/DataAccess/StatementTransclusionInteractor.php
+++ b/client/includes/DataAccess/StatementTransclusionInteractor.php
@@ -79,7 +79,7 @@
public function render(
EntityId $entityId,
$propertyLabelOrId,
- $acceptableRanks = null
+ array $acceptableRanks = null
) {
try {
$entity = $this->entityLookup->getEntity( $entityId );
diff --git a/client/includes/Hooks/SpecialWatchlistQueryHandler.php
b/client/includes/Hooks/SpecialWatchlistQueryHandler.php
index 77337e1..9ac495e 100644
--- a/client/includes/Hooks/SpecialWatchlistQueryHandler.php
+++ b/client/includes/Hooks/SpecialWatchlistQueryHandler.php
@@ -49,7 +49,7 @@
/**
* @param WebRequest $request
* @param array $conds
- * @param FormOptions|null $opts
+ * @param FormOptions|array|null $opts MediaWiki 1.22 used an array and
MobileFrontend still does.
*
* @return array
*/
@@ -67,7 +67,7 @@
/**
* @param WebRequest $request
- * @param FormOptions|null $opts
+ * @param FormOptions|array|null $opts MediaWiki 1.22 used an array and
MobileFrontend still does.
*
* @return boolean
*/
diff --git a/client/includes/RepoLinker.php b/client/includes/RepoLinker.php
index 586b0a2..9af6f71 100644
--- a/client/includes/RepoLinker.php
+++ b/client/includes/RepoLinker.php
@@ -103,7 +103,7 @@
*
* @return string (html)
*/
- public function formatLink( $url, $text, $attribs = array() ) {
+ public function formatLink( $url, $text, array $attribs = array() ) {
$attribs['class'] = isset( $attribs['class'] ) ?
'plainlinks ' . $attribs['class'] : 'plainlinks';
diff --git a/repo/includes/ChangeOp/SiteLinkChangeOpFactory.php
b/repo/includes/ChangeOp/SiteLinkChangeOpFactory.php
index 186fa79..ba17178 100644
--- a/repo/includes/ChangeOp/SiteLinkChangeOpFactory.php
+++ b/repo/includes/ChangeOp/SiteLinkChangeOpFactory.php
@@ -21,7 +21,7 @@
* @throws InvalidArgumentException
* @return ChangeOp
*/
- public function newSetSiteLinkOp( $siteId, $pageName, $badges = null ) {
+ public function newSetSiteLinkOp( $siteId, $pageName, array $badges =
null ) {
return new ChangeOpSiteLink( $siteId, $pageName, $badges );
}
diff --git a/repo/includes/Interactors/ItemMergeInteractor.php
b/repo/includes/Interactors/ItemMergeInteractor.php
index 4ee1349..79b875f 100644
--- a/repo/includes/Interactors/ItemMergeInteractor.php
+++ b/repo/includes/Interactors/ItemMergeInteractor.php
@@ -141,7 +141,7 @@
*
* @throws ItemMergeException
*/
- public function mergeItems( ItemId $fromId, ItemId $toId,
$ignoreConflicts = array(), $summary = null, $bot = false ) {
+ public function mergeItems( ItemId $fromId, ItemId $toId, array
$ignoreConflicts = array(), $summary = null, $bot = false ) {
$this->checkPermissions( $fromId );
$this->checkPermissions( $toId );
diff --git a/view/src/Template/Template.php b/view/src/Template/Template.php
index 8ecb91d..7286878 100644
--- a/view/src/Template/Template.php
+++ b/view/src/Template/Template.php
@@ -24,11 +24,11 @@
* be sure to escape your params before using this class!
*
* @param TemplateRegistry $templateRegistry
- * @param $key: message key, or array of message keys to try
+ * @param string|string[] $key message key, or array of message keys to
try
* and use the first non-empty message for
- * @param $params Array message parameters
+ * @param array $params Array message parameters
*/
- public function __construct( TemplateRegistry $templateRegistry, $key,
$params = array() ) {
+ public function __construct( TemplateRegistry $templateRegistry, $key,
array $params = array() ) {
$this->templateRegistry = $templateRegistry;
parent::__construct( $key, $params );
}
--
To view, visit https://gerrit.wikimedia.org/r/232696
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I950bffd2a52da7f690d73a795ce4a2a62fb9494d
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Hoo man <[email protected]>
Gerrit-Reviewer: Jeroen De Dauw <[email protected]>
Gerrit-Reviewer: Jonas Kress (WMDE) <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits