r82422 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82421‎ | r82422 | r82423 >
Date:23:21, 18 February 2011
Author:reedy
Status:ok
Tags:
Comment:
Explicitally define some variables

Function documentation
Modified paths:
  • /trunk/phase3/includes/db/Database.php (modified) (history)
  • /trunk/phase3/languages/LanguageConverter.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageKk.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageSr.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/db/Database.php
@@ -3128,7 +3128,7 @@
31293129 /**
31303130 * Create a new result object from a result resource and a Database object
31313131 *
3132 - * @param Database $database
 3132+ * @param DatabaseBase $database
31333133 * @param resource $result
31343134 */
31353135 function __construct( $database, $result ) {
Index: trunk/phase3/languages/LanguageConverter.php
@@ -52,7 +52,7 @@
5353 /**
5454 * Constructor
5555 *
56 - * @param $langobj The Language Object
 56+ * @param $langobj Language The Language Object
5757 * @param $maincode String: the main language code of this language
5858 * @param $variants Array: the supported variants of this language
5959 * @param $variantfallbacks Array: the fallback language of each variant
Index: trunk/phase3/languages/classes/LanguageKk.php
@@ -18,6 +18,8 @@
1919 */
2020 class KkConverter extends LanguageConverter {
2121
 22+ protected $mCyrl2Latn, $mLatn2Cyrl, $mCyLa2Arab;
 23+
2224 function __construct( $langobj, $maincode,
2325 $variants = array(),
2426 $variantfallbacks = array(),
@@ -200,6 +202,7 @@
201203 return parent::parseManualRule( $rule, $flags );
202204 }
203205
 206+ $carray = array();
204207 // otherwise ignore all formatting
205208 foreach ( $this->mVariants as $v ) {
206209 $carray[$v] = $rule;
Index: trunk/phase3/languages/classes/LanguageSr.php
@@ -68,6 +68,7 @@
6969 return parent::parseManualRule( $rule, $flags );
7070 }
7171
 72+ $carray = array();
7273 // otherwise ignore all formatting
7374 foreach ( $this->mVariants as $v ) {
7475 $carray[$v] = $rule;
@@ -176,10 +177,14 @@
177178 }
178179
179180 function convertPlural( $count, $forms ) {
180 - if ( !count( $forms ) ) { return ''; }
 181+ if ( !count( $forms ) ) {
 182+ return '';
 183+ }
181184
182185 // if no number with word, then use $form[0] for singular and $form[1] for plural or zero
183 - if ( count( $forms ) === 2 ) return $count == 1 ? $forms[0] : $forms[1];
 186+ if ( count( $forms ) === 2 ) {
 187+ return $count == 1 ? $forms[0] : $forms[1];
 188+ }
184189
185190 // FIXME: CLDR defines 4 plural forms. Form with decimals missing.
186191 // See http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#ru

Status & tagging log