jenkins-bot has submitted this change and it was merged.
Change subject: Type hint array parameters with a default value
......................................................................
Type hint array parameters with a default value
Change-Id: I3239595a03963bc0b28e58b12cecc8ea12ecefad
---
M TranslateUtils.php
M ffs/MediaWikiComplexMessages.php
M stringmangler/StringMatcher.php
M tag/SpecialPageTranslationDeletePage.php
M tag/SpecialPageTranslationMovePage.php
M utils/MessageGroupStats.php
M utils/TranslateLogFormatter.php
M utils/TranslationHelpers.php
8 files changed, 16 insertions(+), 14 deletions(-)
Approvals:
Nikerabbit: Looks good to me, approved
jenkins-bot: Verified
diff --git a/TranslateUtils.php b/TranslateUtils.php
index 29ed6a3..4a810a5 100644
--- a/TranslateUtils.php
+++ b/TranslateUtils.php
@@ -106,7 +106,7 @@
* @return array List of recent changes.
*/
public static function translationChanges(
- $hours = 24, $bots = false, $ns = null, $extraFields = array()
+ $hours = 24, $bots = false, $ns = null, array $extraFields =
array()
) {
global $wgTranslateMessageNamespaces;
@@ -264,7 +264,7 @@
* @param array $attributes Html attributes for the fieldset.
* @return string Html.
*/
- public static function fieldset( $legend, $contents, $attributes =
array() ) {
+ public static function fieldset( $legend, $contents, array $attributes
= array() ) {
return Xml::openElement( 'fieldset', $attributes ) .
Xml::tags( 'legend', null, $legend ) . $contents .
Xml::closeElement( 'fieldset' );
diff --git a/ffs/MediaWikiComplexMessages.php b/ffs/MediaWikiComplexMessages.php
index 7918d24..463fb84 100644
--- a/ffs/MediaWikiComplexMessages.php
+++ b/ffs/MediaWikiComplexMessages.php
@@ -433,7 +433,7 @@
// /Save to database
// Export
- public function validate( &$errors = array(), $filter = false ) {
+ public function validate( array &$errors, $filter = false ) {
$used = array();
foreach ( array_keys( $this->data ) as $group ) {
if ( $filter !== false && !in_array( $group,
(array)$filter, true ) ) {
@@ -444,7 +444,7 @@
}
}
- protected function validateEach( &$errors = array(), $group, &$used ) {
+ protected function validateEach( array &$errors, $group, &$used ) {
foreach ( $this->getIterator( $group ) as $key ) {
$values = $this->val( $group, self::LANG_CURRENT, $key
);
$link = Xml::element( 'a', array( 'href' =>
"#mw-sp-magic-$key" ), $key );
diff --git a/stringmangler/StringMatcher.php b/stringmangler/StringMatcher.php
index e2b5043..31ef6e1 100644
--- a/stringmangler/StringMatcher.php
+++ b/stringmangler/StringMatcher.php
@@ -27,7 +27,7 @@
* @return StringMatcher
*/
public static function EmptyMatcher() {
- return new StringMatcher;
+ return new StringMatcher();
}
/**
@@ -36,7 +36,7 @@
* @param string $prefix
* @param array $patterns
*/
- public function __construct( $prefix = '', $patterns = array() ) {
+ public function __construct( $prefix = '', array $patterns = array() ) {
$this->sPrefix = $prefix;
$this->init( $patterns );
}
diff --git a/tag/SpecialPageTranslationDeletePage.php
b/tag/SpecialPageTranslationDeletePage.php
index 57ee3fb..98d49a4 100644
--- a/tag/SpecialPageTranslationDeletePage.php
+++ b/tag/SpecialPageTranslationDeletePage.php
@@ -221,7 +221,7 @@
* @param array $attribs Extra attributes. Default empty array.
*/
protected function addInputLabel( &$form, $label, $name, $size = false,
$text = false,
- $attribs = array()
+ array $attribs = array()
) {
$br = Html::element( 'br' );
list( $label, $input ) = Xml::inputLabelSep( $label, $name,
$name, $size, $text, $attribs );
diff --git a/tag/SpecialPageTranslationMovePage.php
b/tag/SpecialPageTranslationMovePage.php
index 5702586..4bd9fe5 100644
--- a/tag/SpecialPageTranslationMovePage.php
+++ b/tag/SpecialPageTranslationMovePage.php
@@ -274,7 +274,7 @@
* @param array $attribs Extra attributes. Default empty array.
*/
protected function addInputLabel( &$form, $label, $name, $size = false,
$text = false,
- $attribs = array()
+ array $attribs = array()
) {
$br = Html::element( 'br' );
list( $label, $input ) = Xml::inputLabelSep(
diff --git a/utils/MessageGroupStats.php b/utils/MessageGroupStats.php
index ff87534..8edc648 100644
--- a/utils/MessageGroupStats.php
+++ b/utils/MessageGroupStats.php
@@ -194,7 +194,7 @@
wfDebugLog( 'messagegroupstats', 'Cleared everything :(' );
}
- protected static function extractResults( $res, $stats = array() ) {
+ protected static function extractResults( $res, array $stats = array()
) {
foreach ( $res as $row ) {
$stats[$row->tgs_group][$row->tgs_lang] =
self::extractNumbers( $row );
}
@@ -202,7 +202,7 @@
return $stats;
}
- public static function update( MessageHandle $handle, $changes =
array() ) {
+ public static function update( MessageHandle $handle, array $changes =
array() ) {
$dbw = wfGetDB( DB_MASTER );
$conds = array(
'tgs_group' => $handle->getGroupIds(),
@@ -239,7 +239,7 @@
* @param array[] $stats
* @return array[]
*/
- protected static function forLanguageInternal( $code, $stats = array()
) {
+ protected static function forLanguageInternal( $code, array $stats =
array() ) {
$res = self::selectRowsIdLang( null, $code );
$stats = self::extractResults( $res, $stats );
@@ -278,7 +278,7 @@
* @param array[] $stats
* @return array[]
*/
- protected static function forGroupInternal( $group, $stats = array() ) {
+ protected static function forGroupInternal( $group, array $stats =
array() ) {
$id = $group->getId();
$res = self::selectRowsIdLang( $id, null );
$stats = self::extractResults( $res, $stats );
diff --git a/utils/TranslateLogFormatter.php b/utils/TranslateLogFormatter.php
index 019d6c5..c809f97 100644
--- a/utils/TranslateLogFormatter.php
+++ b/utils/TranslateLogFormatter.php
@@ -63,7 +63,9 @@
return $message->isBlank() ? $value : $message->text();
}
- protected function makePageLinkWithText( Title $title = null, $text,
$parameters = array() ) {
+ protected function makePageLinkWithText(
+ Title $title = null, $text, array $parameters = array()
+ ) {
if ( !$this->plaintext ) {
$link = Linker::link( $title, htmlspecialchars( $text
), array(), $parameters );
} else {
diff --git a/utils/TranslationHelpers.php b/utils/TranslationHelpers.php
index 41c30a6..5209ed3 100644
--- a/utils/TranslationHelpers.php
+++ b/utils/TranslationHelpers.php
@@ -213,7 +213,7 @@
* @param array $params
* @return mixed
*/
- public function callBox( $type, $cb, $params = array() ) {
+ public function callBox( $type, $cb, array $params = array() ) {
try {
return call_user_func_array( $cb, $params );
} catch ( TranslationHelperException $e ) {
--
To view, visit https://gerrit.wikimedia.org/r/275016
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I3239595a03963bc0b28e58b12cecc8ea12ecefad
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Siebrand <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits