Index: trunk/phase3/includes/WebRequest.php |
— | — | @@ -946,7 +946,7 @@ |
947 | 947 | |
948 | 948 | /** |
949 | 949 | * Parse the Accept-Language header sent by the client into an array |
950 | | - * @return array( languageCode => q-value ) sorted by q-value in descending order |
| 950 | + * @return array array( languageCode => q-value ) sorted by q-value in descending order |
951 | 951 | * May contain the "language" '*', which applies to languages other than those explicitly listed. |
952 | 952 | * This is aligned with rfc2616 section 14.4 |
953 | 953 | */ |
Index: trunk/phase3/languages/LanguageConverter.php |
— | — | @@ -117,7 +117,7 @@ |
118 | 118 | * in this case. Right now this is only used by zh. |
119 | 119 | * |
120 | 120 | * @param $variant String: the language code of the variant |
121 | | - * @return String: The code of the fallback language or the |
| 121 | + * @return String|array: The code of the fallback language or the |
122 | 122 | * main code if there is no fallback |
123 | 123 | */ |
124 | 124 | public function getVariantFallbacks( $variant ) { |
— | — | @@ -368,11 +368,11 @@ |
369 | 369 | $sourceBlob .= substr( $text, $startPos, $elementPos - $startPos ) . "\000"; |
370 | 370 | |
371 | 371 | // Advance to the next position |
372 | | - $startPos = $elementPos + strlen( $element ); |
| 372 | + $startPos = $elementPos + strlen( $element ); |
373 | 373 | |
374 | 374 | // Translate any alt or title attributes inside the matched element |
375 | | - if ( $element !== '' && preg_match( '/^(<[^>\s]*)\s([^>]*)(.*)$/', $element, |
376 | | - $elementMatches ) ) |
| 375 | + if ( $element !== '' && preg_match( '/^(<[^>\s]*)\s([^>]*)(.*)$/', $element, |
| 376 | + $elementMatches ) ) |
377 | 377 | { |
378 | 378 | $attrs = Sanitizer::decodeTagAttributes( $elementMatches[2] ); |
379 | 379 | $changed = false; |
— | — | @@ -385,7 +385,7 @@ |
386 | 386 | if ( !strpos( $attr, '://' ) ) { |
387 | 387 | $attr = $this->translate( $attr, $toVariant ); |
388 | 388 | } |
389 | | - |
| 389 | + |
390 | 390 | // Remove HTML tags to avoid disrupting the layout |
391 | 391 | $attr = preg_replace( '/<[^>]+>/', '', $attr ); |
392 | 392 | if ( $attr !== $attrs[$attrName] ) { |
— | — | @@ -394,7 +394,7 @@ |
395 | 395 | } |
396 | 396 | } |
397 | 397 | if ( $changed ) { |
398 | | - $element = $elementMatches[1] . Html::expandAttributes( $attrs ) . |
| 398 | + $element = $elementMatches[1] . Html::expandAttributes( $attrs ) . |
399 | 399 | $elementMatches[3]; |
400 | 400 | } |
401 | 401 | } |
Index: trunk/phase3/languages/Language.php |
— | — | @@ -239,7 +239,7 @@ |
240 | 240 | /** |
241 | 241 | * Includes language class files |
242 | 242 | * |
243 | | - * @param $class Name of the language class |
| 243 | + * @param $class string Name of the language class |
244 | 244 | */ |
245 | 245 | public static function preloadLanguageClass( $class ) { |
246 | 246 | global $IP; |
— | — | @@ -1212,7 +1212,7 @@ |
1213 | 1213 | } |
1214 | 1214 | |
1215 | 1215 | // Days passed in current month |
1216 | | - $gDayNo += $gd; |
| 1216 | + $gDayNo += (int)$gd; |
1217 | 1217 | |
1218 | 1218 | $jDayNo = $gDayNo - 79; |
1219 | 1219 | |
— | — | @@ -1573,7 +1573,7 @@ |
1574 | 1574 | $s = ''; |
1575 | 1575 | for ( $pow10 = 1000, $i = 3; $i >= 0; $pow10 /= 10, $i-- ) { |
1576 | 1576 | if ( $num >= $pow10 ) { |
1577 | | - $s .= $table[$i][floor( $num / $pow10 )]; |
| 1577 | + $s .= $table[$i][(int)floor( $num / $pow10 )]; |
1578 | 1578 | } |
1579 | 1579 | $num = $num % $pow10; |
1580 | 1580 | } |
— | — | @@ -3097,10 +3097,10 @@ |
3098 | 3098 | * truncateHtml() helper function |
3099 | 3099 | * (a) push or pop $tag from $openTags as needed |
3100 | 3100 | * (b) clear $tag value |
3101 | | - * @param String &$tag Current HTML tag name we are looking at |
3102 | | - * @param int $tagType (0-open tag, 1-close tag) |
3103 | | - * @param char $lastCh Character before the '>' that ended this tag |
3104 | | - * @param array &$openTags Open tag stack (not accounting for $tag) |
| 3101 | + * @param &$tag string Current HTML tag name we are looking at |
| 3102 | + * @param $tagType int (0-open tag, 1-close tag) |
| 3103 | + * @param $lastCh char|string Character before the '>' that ended this tag |
| 3104 | + * @param &$openTags array Open tag stack (not accounting for $tag) |
3105 | 3105 | */ |
3106 | 3106 | private function truncate_endBracket( &$tag, $tagType, $lastCh, &$openTags ) { |
3107 | 3107 | $tag = ltrim( $tag ); |
— | — | @@ -3762,7 +3762,7 @@ |
3763 | 3763 | if ( $bps <= 0 ) { |
3764 | 3764 | return $this->formatNum( $bps ) . $units[0]; |
3765 | 3765 | } |
3766 | | - $unitIndex = floor( log10( $bps ) / 3 ); |
| 3766 | + $unitIndex = (int)floor( log10( $bps ) / 3 ); |
3767 | 3767 | $mantissa = $bps / pow( 1000, $unitIndex ); |
3768 | 3768 | if ( $mantissa < 10 ) { |
3769 | 3769 | $mantissa = round( $mantissa, 1 ); |
Index: trunk/phase3/languages/classes/LanguageIu.php |
— | — | @@ -7,8 +7,8 @@ |
8 | 8 | * Conversion script between Latin and Syllabics for Inuktitut. |
9 | 9 | * - Syllabics -> lowercase Latin |
10 | 10 | * - lowercase/uppercase Latin -> Syllabics |
11 | | -* |
12 | 11 | * |
| 12 | +* |
13 | 13 | * Based on: |
14 | 14 | * - http://commons.wikimedia.org/wiki/Image:Inuktitut.png |
15 | 15 | * - LanguageSr.php |
— | — | @@ -21,6 +21,8 @@ |
22 | 22 | * |
23 | 23 | */ |
24 | 24 | class IuConverter extends LanguageConverter { |
| 25 | + |
| 26 | + protected $mDoContentConvert; |
25 | 27 | var $mToLatin = array( |
26 | 28 | 'ᐦ' => 'h', 'ᐃ' => 'i', 'ᐄ' => 'ii', 'ᐅ' => 'u', 'ᐆ' => 'uu', 'ᐊ' => 'a', 'ᐋ' => 'aa', |
27 | 29 | 'ᑉ' => 'p', 'ᐱ' => 'pi', 'ᐲ' => 'pii', 'ᐳ' => 'pu', 'ᐴ' => 'puu', 'ᐸ' => 'pa', 'ᐹ' => 'paa', |
— | — | @@ -111,10 +113,7 @@ |
112 | 114 | * @return string |
113 | 115 | */ |
114 | 116 | function parserConvert( $text, &$parser ) { |
115 | | - if ( is_object( $parser->getTitle() ) && $parser->getTitle()->isTalkPage() ) |
116 | | - $this->mDoContentConvert = false; |
117 | | - else |
118 | | - $this->mDoContentConvert = true; |
| 117 | + $this->mDoContentConvert = !( is_object( $parser->getTitle() ) && $parser->getTitle()->isTalkPage() ); |
119 | 118 | |
120 | 119 | return parent::parserConvert( $text, $parser ); |
121 | 120 | } |
Index: trunk/phase3/languages/classes/LanguageShi.php |
— | — | @@ -7,8 +7,8 @@ |
8 | 8 | * Conversion script between Latin and Tifinagh for Tachelhit. |
9 | 9 | * - Tifinagh -> lowercase Latin |
10 | 10 | * - lowercase/uppercase Latin -> Tifinagh |
11 | | -* |
12 | 11 | * |
| 12 | +* |
13 | 13 | * Based on: |
14 | 14 | * - http://en.wikipedia.org/wiki/Shilha_language |
15 | 15 | * - LanguageSr.php |
— | — | @@ -21,6 +21,9 @@ |
22 | 22 | * |
23 | 23 | */ |
24 | 24 | class ShiConverter extends LanguageConverter { |
| 25 | + |
| 26 | + protected $mDoContentConvert; |
| 27 | + |
25 | 28 | var $mToLatin = array( |
26 | 29 | 'ⴰ' => 'a', 'ⴱ' => 'b', 'ⴳ' => 'g', 'ⴷ' => 'd', 'ⴹ' => 'ḍ', 'ⴻ' => 'e', |
27 | 30 | 'ⴼ' => 'f', 'ⴽ' => 'k', 'ⵀ' => 'h', 'ⵃ' => 'ḥ', 'ⵄ' => 'ε', 'ⵅ' => 'x', |
— | — | @@ -89,10 +92,7 @@ |
90 | 93 | * @return string |
91 | 94 | */ |
92 | 95 | function parserConvert( $text, &$parser ) { |
93 | | - if ( is_object( $parser->getTitle() ) && $parser->getTitle()->isTalkPage() ) |
94 | | - $this->mDoContentConvert = false; |
95 | | - else |
96 | | - $this->mDoContentConvert = true; |
| 96 | + $this->mDoContentConvert = !( is_object( $parser->getTitle() ) && $parser->getTitle()->isTalkPage() ); |
97 | 97 | |
98 | 98 | return parent::parserConvert( $text, $parser ); |
99 | 99 | } |
Index: trunk/phase3/languages/classes/LanguageQqx.php |
— | — | @@ -9,6 +9,10 @@ |
10 | 10 | * @ingroup Language |
11 | 11 | */ |
12 | 12 | class LanguageQqx extends Language { |
| 13 | + /** |
| 14 | + * @param $key string |
| 15 | + * @return string |
| 16 | + */ |
13 | 17 | function getMessage( $key ) { |
14 | 18 | return "($key)"; |
15 | 19 | } |