r89113 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89112‎ | r89113 | r89114 >
Date:15:40, 29 May 2011
Author:reedy
Status:ok
Tags:
Comment:
Fleshed out file
Modified paths:
  • /trunk/phase3/languages/Language.php (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/Language.php
@@ -202,6 +202,8 @@
203203 * not it exists. This includes codes which are used solely for
204204 * customisation via the MediaWiki namespace.
205205 *
 206+ * @param $code string
 207+ *
206208 * @return bool
207209 */
208210 public static function isValidCode( $code ) {
@@ -213,6 +215,10 @@
214216 /**
215217 * Returns true if a language code is of a valid form for the purposes of
216218 * internal customisation of MediaWiki, via Messages*.php.
 219+ *
 220+ * @param $code string
 221+ *
 222+ * @return bool
217223 */
218224 public static function isValidBuiltInCode( $code ) {
219225 return preg_match( '/^[a-z0-9-]*$/i', $code );
@@ -258,6 +264,9 @@
259265 */
260266 function initContLang() { }
261267
 268+ /**
 269+ * @return array|bool
 270+ */
262271 function getFallbackLanguageCode() {
263272 if ( $this->mCode === 'en' ) {
264273 return false;
@@ -345,6 +354,8 @@
346355 * getNsText() except with '_' changed to ' ', useful for
347356 * producing output.
348357 *
 358+ * @param $index string
 359+ *
349360 * @return array
350361 */
351362 function getFormattedNsText( $index ) {
@@ -389,6 +400,9 @@
390401 return isset( $ids[$lctext] ) ? $ids[$lctext] : false;
391402 }
392403
 404+ /**
 405+ * @return array
 406+ */
393407 function getNamespaceAliases() {
394408 if ( is_null( $this->namespaceAliases ) ) {
395409 $aliases = self::$dataCache->getItem( $this->mCode, 'namespaceAliases' );
@@ -416,6 +430,9 @@
417431 return $this->namespaceAliases;
418432 }
419433
 434+ /**
 435+ * @return array
 436+ */
420437 function getNamespaceIds() {
421438 if ( is_null( $this->mNamespaceIds ) ) {
422439 global $wgNamespaceAliases;
@@ -466,6 +483,10 @@
467484 return $this->getMessageFromDB( "variantname-$code" );
468485 }
469486
 487+ /**
 488+ * @param $name string
 489+ * @return string
 490+ */
470491 function specialPage( $name ) {
471492 $aliases = $this->getSpecialPageAliases();
472493 if ( isset( $aliases[$name][0] ) ) {
@@ -474,6 +495,9 @@
475496 return $this->getNsText( NS_SPECIAL ) . ':' . $name;
476497 }
477498
 499+ /**
 500+ * @return array
 501+ */
478502 function getQuickbarSettings() {
479503 return array(
480504 $this->getMessage( 'qbsettings-none' ),
@@ -484,14 +508,23 @@
485509 );
486510 }
487511
 512+ /**
 513+ * @return array
 514+ */
488515 function getDatePreferences() {
489516 return self::$dataCache->getItem( $this->mCode, 'datePreferences' );
490517 }
491518
 519+ /**
 520+ * @return array
 521+ */
492522 function getDateFormats() {
493523 return self::$dataCache->getItem( $this->mCode, 'dateFormats' );
494524 }
495525
 526+ /**
 527+ * @return array|string
 528+ */
496529 function getDefaultDateFormat() {
497530 $df = self::$dataCache->getItem( $this->mCode, 'defaultDateFormat' );
498531 if ( $df === 'dmy or mdy' ) {
@@ -502,22 +535,39 @@
503536 }
504537 }
505538
 539+ /**
 540+ * @return array
 541+ */
506542 function getDatePreferenceMigrationMap() {
507543 return self::$dataCache->getItem( $this->mCode, 'datePreferenceMigrationMap' );
508544 }
509545
 546+ /**
 547+ * @param $image
 548+ * @return array|null
 549+ */
510550 function getImageFile( $image ) {
511551 return self::$dataCache->getSubitem( $this->mCode, 'imageFiles', $image );
512552 }
513553
 554+ /**
 555+ * @return array
 556+ */
514557 function getDefaultUserOptionOverrides() {
515558 return self::$dataCache->getItem( $this->mCode, 'defaultUserOptionOverrides' );
516559 }
517560
 561+ /**
 562+ * @return array
 563+ */
518564 function getExtraUserToggles() {
519565 return self::$dataCache->getItem( $this->mCode, 'extraUserToggles' );
520566 }
521567
 568+ /**
 569+ * @param $tog
 570+ * @return string
 571+ */
522572 function getUserToggle( $tog ) {
523573 return $this->getMessageFromDB( "tog-$tog" );
524574 }
@@ -525,6 +575,10 @@
526576 /**
527577 * Get language names, indexed by code.
528578 * If $customisedOnly is true, only returns codes with a messages file
 579+ *
 580+ * @param $customisedOnly bool
 581+ *
 582+ * @return array
529583 */
530584 public static function getLanguageNames( $customisedOnly = false ) {
531585 global $wgExtraLanguageNames;
@@ -581,6 +635,10 @@
582636 return wfMsgExt( $msg, array( 'parsemag', 'language' => $this ) );
583637 }
584638
 639+ /**
 640+ * @param $code string
 641+ * @return string
 642+ */
585643 function getLanguageName( $code ) {
586644 $names = self::getLanguageNames();
587645 if ( !array_key_exists( $code, $names ) ) {
@@ -589,10 +647,17 @@
590648 return $names[$code];
591649 }
592650
 651+ /**
 652+ * @param $key string
 653+ * @return string
 654+ */
593655 function getMonthName( $key ) {
594656 return $this->getMessageFromDB( self::$mMonthMsgs[$key - 1] );
595657 }
596658
 659+ /**
 660+ * @return array
 661+ */
597662 function getMonthNamesArray() {
598663 $monthNames = array( '' );
599664 for ( $i=1; $i < 13; $i++ ) {
@@ -601,42 +666,77 @@
602667 return $monthNames;
603668 }
604669
 670+ /**
 671+ * @param $key string
 672+ * @return string
 673+ */
605674 function getMonthNameGen( $key ) {
606675 return $this->getMessageFromDB( self::$mMonthGenMsgs[$key - 1] );
607676 }
608677
 678+ /**
 679+ * @param $key string
 680+ * @return string
 681+ */
609682 function getMonthAbbreviation( $key ) {
610683 return $this->getMessageFromDB( self::$mMonthAbbrevMsgs[$key - 1] );
611684 }
612685
 686+ /**
 687+ * @return array
 688+ */
613689 function getMonthAbbreviationsArray() {
614 - $monthNames = array('');
 690+ $monthNames = array( '' );
615691 for ( $i=1; $i < 13; $i++ ) {
616692 $monthNames[] = $this->getMonthAbbreviation( $i );
617693 }
618694 return $monthNames;
619695 }
620696
 697+ /**
 698+ * @param $key string
 699+ * @return string
 700+ */
621701 function getWeekdayName( $key ) {
622702 return $this->getMessageFromDB( self::$mWeekdayMsgs[$key - 1] );
623703 }
624704
 705+ /**
 706+ * @param $key string
 707+ * @return string
 708+ */
625709 function getWeekdayAbbreviation( $key ) {
626710 return $this->getMessageFromDB( self::$mWeekdayAbbrevMsgs[$key - 1] );
627711 }
628712
 713+ /**
 714+ * @param $key string
 715+ * @return string
 716+ */
629717 function getIranianCalendarMonthName( $key ) {
630718 return $this->getMessageFromDB( self::$mIranianCalendarMonthMsgs[$key - 1] );
631719 }
632720
 721+ /**
 722+ * @param $key string
 723+ * @return string
 724+ */
633725 function getHebrewCalendarMonthName( $key ) {
634726 return $this->getMessageFromDB( self::$mHebrewCalendarMonthMsgs[$key - 1] );
635727 }
636728
 729+ /**
 730+ * @param $key string
 731+ * @return string
 732+ */
637733 function getHebrewCalendarMonthNameGen( $key ) {
638734 return $this->getMessageFromDB( self::$mHebrewCalendarMonthGenMsgs[$key - 1] );
639735 }
640736
 737+ /**
 738+ * @param $key string
 739+ * @return string
 740+ */
641741 function getHijriCalendarMonthName( $key ) {
642742 return $this->getMessageFromDB( self::$mHijriCalendarMonthMsgs[$key - 1] );
643743 }
@@ -772,6 +872,8 @@
773873 * YYYYMMDDHHMMSS
774874 * 01234567890123
775875 * @todo handling of "o" format character for Iranian, Hebrew, Hijri & Thai?
 876+ *
 877+ * @return string
776878 */
777879 function sprintfDate( $format, $ts ) {
778880 $s = '';
@@ -1084,6 +1186,7 @@
10851187
10861188 private static $GREG_DAYS = array( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 );
10871189 private static $IRANIAN_DAYS = array( 31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29 );
 1190+
10881191 /**
10891192 * Algorithm by Roozbeh Pournader and Mohammad Toossi to convert
10901193 * Gregorian dates to Iranian dates. Originally written in C, it
@@ -1091,6 +1194,10 @@
10921195 * License. Conversion to PHP was performed by Niklas Laxström.
10931196 *
10941197 * Link: http://www.farsiweb.info/jalali/jalali.c
 1198+ *
 1199+ * @param $ts string
 1200+ *
 1201+ * @return string
10951202 */
10961203 private static function tsToIranian( $ts ) {
10971204 $gy = substr( $ts, 0, 4 ) -1600;
@@ -1146,6 +1253,10 @@
11471254 * Based on a PHP-Nuke block by Sharjeel which is released under GNU/GPL license
11481255 *
11491256 * @link http://phpnuke.org/modules.php?name=News&file=article&sid=8234&mode=thread&order=0&thold=0
 1257+ *
 1258+ * @param $ts string
 1259+ *
 1260+ * @return string
11501261 */
11511262 private static function tsToHijri( $ts ) {
11521263 $year = substr( $ts, 0, 4 );
@@ -1193,6 +1304,10 @@
11941305 *
11951306 * The months are counted from Tishrei = 1. In a leap year, Adar I is 13
11961307 * and Adar II is 14. In a non-leap year, Adar is 6.
 1308+ *
 1309+ * @param $ts string
 1310+ *
 1311+ * @return string
11971312 */
11981313 private static function tsToHebrew( $ts ) {
11991314 # Parse date
@@ -1330,6 +1445,10 @@
13311446 * This calculates the Hebrew year start, as days since 1 September.
13321447 * Based on Carl Friedrich Gauss algorithm for finding Easter date.
13331448 * Used for Hebrew date.
 1449+ *
 1450+ * @param $year int
 1451+ *
 1452+ * @return string
13341453 */
13351454 private static function hebrewYearStart( $year ) {
13361455 $a = intval( ( 12 * ( $year - 1 ) + 17 ) % 19 );
@@ -1443,6 +1562,10 @@
14441563
14451564 /**
14461565 * Roman number formatting up to 3000
 1566+ *
 1567+ * @param $num int
 1568+ *
 1569+ * @return string
14471570 */
14481571 static function romanNumeral( $num ) {
14491572 static $table = array(
@@ -1469,6 +1592,10 @@
14701593
14711594 /**
14721595 * Hebrew Gematria number formatting up to 9999
 1596+ *
 1597+ * @param $num int
 1598+ *
 1599+ * @return string
14731600 */
14741601 static function hebrewNumeral( $num ) {
14751602 static $table = array(
@@ -1646,14 +1773,27 @@
16471774 return $this->sprintfDate( $df, $ts );
16481775 }
16491776
 1777+ /**
 1778+ * @param $key string
 1779+ * @return array|null
 1780+ */
16501781 function getMessage( $key ) {
16511782 return self::$dataCache->getSubitem( $this->mCode, 'messages', $key );
16521783 }
16531784
 1785+ /**
 1786+ * @return array
 1787+ */
16541788 function getAllMessages() {
16551789 return self::$dataCache->getItem( $this->mCode, 'messages' );
16561790 }
16571791
 1792+ /**
 1793+ * @param $in
 1794+ * @param $out
 1795+ * @param $string
 1796+ * @return string
 1797+ */
16581798 function iconv( $in, $out, $string ) {
16591799 # This is a wrapper for iconv in all languages except esperanto,
16601800 # which does some nasty x-conversions beforehand
@@ -1669,28 +1809,53 @@
16701810 }
16711811
16721812 // callback functions for uc(), lc(), ucwords(), ucwordbreaks()
 1813+
 1814+ /**
 1815+ * @param $matches array
 1816+ * @return mixed|string
 1817+ */
16731818 function ucwordbreaksCallbackAscii( $matches ) {
16741819 return $this->ucfirst( $matches[1] );
16751820 }
16761821
 1822+ /**
 1823+ * @param $matches array
 1824+ * @return string
 1825+ */
16771826 function ucwordbreaksCallbackMB( $matches ) {
16781827 return mb_strtoupper( $matches[0] );
16791828 }
16801829
 1830+ /**
 1831+ * @param $matches array
 1832+ * @return string
 1833+ */
16811834 function ucCallback( $matches ) {
16821835 list( $wikiUpperChars ) = self::getCaseMaps();
16831836 return strtr( $matches[1], $wikiUpperChars );
16841837 }
16851838
 1839+ /**
 1840+ * @param $matches array
 1841+ * @return string
 1842+ */
16861843 function lcCallback( $matches ) {
16871844 list( , $wikiLowerChars ) = self::getCaseMaps();
16881845 return strtr( $matches[1], $wikiLowerChars );
16891846 }
16901847
 1848+ /**
 1849+ * @param $matches array
 1850+ * @return string
 1851+ */
16911852 function ucwordsCallbackMB( $matches ) {
16921853 return mb_strtoupper( $matches[0] );
16931854 }
16941855
 1856+ /**
 1857+ * @param $matches array
 1858+ * @return string
 1859+ */
16951860 function ucwordsCallbackWiki( $matches ) {
16961861 list( $wikiUpperChars ) = self::getCaseMaps();
16971862 return strtr( $matches[0], $wikiUpperChars );
@@ -1698,6 +1863,10 @@
16991864
17001865 /**
17011866 * Make a string's first character uppercase
 1867+ *
 1868+ * @param $str string
 1869+ *
 1870+ * @return string
17021871 */
17031872 function ucfirst( $str ) {
17041873 $o = ord( $str );
@@ -1713,6 +1882,11 @@
17141883
17151884 /**
17161885 * Convert a string to uppercase
 1886+ *
 1887+ * @param $str string
 1888+ * @param $first bool
 1889+ *
 1890+ * @return string
17171891 */
17181892 function uc( $str, $first = false ) {
17191893 if ( function_exists( 'mb_strtoupper' ) ) {
@@ -1739,6 +1913,10 @@
17401914 }
17411915 }
17421916
 1917+ /**
 1918+ * @param $str string
 1919+ * @return mixed|string
 1920+ */
17431921 function lcfirst( $str ) {
17441922 $o = ord( $str );
17451923 if ( !$o ) {
@@ -1753,6 +1931,11 @@
17541932 }
17551933 }
17561934
 1935+ /**
 1936+ * @param $str string
 1937+ * @param $first bool
 1938+ * @return mixed|string
 1939+ */
17571940 function lc( $str, $first = false ) {
17581941 if ( function_exists( 'mb_strtolower' ) ) {
17591942 if ( $first ) {
@@ -1778,10 +1961,18 @@
17791962 }
17801963 }
17811964
 1965+ /**
 1966+ * @param $str string
 1967+ * @return bool
 1968+ */
17821969 function isMultibyte( $str ) {
17831970 return (bool)preg_match( '/[\x80-\xff]/', $str );
17841971 }
17851972
 1973+ /**
 1974+ * @param $str string
 1975+ * @return mixed|string
 1976+ */
17861977 function ucwords( $str ) {
17871978 if ( $this->isMultibyte( $str ) ) {
17881979 $str = $this->lc( $str );
@@ -1808,7 +1999,12 @@
18092000 }
18102001 }
18112002
1812 - # capitalize words at word breaks
 2003+ /**
 2004+ * capitalize words at word breaks
 2005+ *
 2006+ * @param $str string
 2007+ * @return mixed
 2008+ */
18132009 function ucwordbreaks( $str ) {
18142010 if ( $this->isMultibyte( $str ) ) {
18152011 $str = $this->lc( $str );
@@ -1851,11 +2047,19 @@
18522048 * Do *not* perform any other normalisation in this function. If a caller
18532049 * uses this function when it should be using a more general normalisation
18542050 * function, then fix the caller.
 2051+ *
 2052+ * @param $s string
 2053+ *
 2054+ * @return string
18552055 */
18562056 function caseFold( $s ) {
18572057 return $this->uc( $s );
18582058 }
18592059
 2060+ /**
 2061+ * @param $s string
 2062+ * @return string
 2063+ */
18602064 function checkTitleEncoding( $s ) {
18612065 if ( is_array( $s ) ) {
18622066 wfDebugDieBacktrace( 'Given array to checkTitleEncoding.' );
@@ -1887,6 +2091,8 @@
18882092 * Some languages such as Chinese don't conventionally do this,
18892093 * which requires special handling when breaking up words for
18902094 * searching etc.
 2095+ *
 2096+ * @return bool
18912097 */
18922098 function hasWordBreaks() {
18932099 return true;
@@ -1917,6 +2123,10 @@
19182124 /**
19192125 * convert double-width roman characters to single-width.
19202126 * range: ff00-ff5f ~= 0020-007f
 2127+ *
 2128+ * @param $string string
 2129+ *
 2130+ * @return string
19212131 */
19222132 protected static function convertDoubleWidth( $string ) {
19232133 static $full = null;
@@ -1933,12 +2143,21 @@
19342144 return $string;
19352145 }
19362146
 2147+ /**
 2148+ * @param $string string
 2149+ * @param $pattern string
 2150+ * @return string
 2151+ */
19372152 protected static function insertSpace( $string, $pattern ) {
19382153 $string = preg_replace( $pattern, " $1 ", $string );
19392154 $string = preg_replace( '/ +/', ' ', $string );
19402155 return $string;
19412156 }
19422157
 2158+ /**
 2159+ * @param $termsArray array
 2160+ * @return array
 2161+ */
19432162 function convertForSearchResult( $termsArray ) {
19442163 # some languages, e.g. Chinese, need to do a conversion
19452164 # in order for search results to be displayed correctly
@@ -2010,6 +2229,10 @@
20112230 # an override to the defaults can be set here on startup.
20122231 }
20132232
 2233+ /**
 2234+ * @param $s string
 2235+ * @return string
 2236+ */
20142237 function recodeForEdit( $s ) {
20152238 # For some languages we'll want to explicitly specify
20162239 # which characters make it into the edit box raw
@@ -2025,6 +2248,10 @@
20262249 }
20272250 }
20282251
 2252+ /**
 2253+ * @param $s string
 2254+ * @return string
 2255+ */
20292256 function recodeInput( $s ) {
20302257 # Take the previous into account.
20312258 global $wgEditEncoding;
@@ -2046,6 +2273,10 @@
20472274 * to the modern Unicode equivalent.
20482275 *
20492276 * This is language-specific for performance reasons only.
 2277+ *
 2278+ * @param $s string
 2279+ *
 2280+ * @return string
20502281 */
20512282 function normalize( $s ) {
20522283 global $wgAllUnicodeFixes;
@@ -2065,6 +2296,11 @@
20662297 *
20672298 * The data is cached in process memory. This will go faster if you have the
20682299 * FastStringSearch extension.
 2300+ *
 2301+ * @param $file string
 2302+ * @param $string string
 2303+ *
 2304+ * @return string
20692305 */
20702306 function transformUsingPairFile( $file, $string ) {
20712307 if ( !isset( $this->transformData[$file] ) ) {
@@ -2169,7 +2405,11 @@
21702406 wfProfileOut( 'LanguageGetMagic' );
21712407 }
21722408
2173 - # Fill a MagicWord object with data from here
 2409+ /**
 2410+ * Fill a MagicWord object with data from here
 2411+ *
 2412+ * @param $mw
 2413+ */
21742414 function getMagic( $mw ) {
21752415 $this->doMagicHook();
21762416
@@ -2194,6 +2434,8 @@
21952435
21962436 /**
21972437 * Add magic words to the extension array
 2438+ *
 2439+ * @param $newWords array
21982440 */
21992441 function addMagicWordsByLang( $newWords ) {
22002442 $code = $this->getCode();
@@ -2284,6 +2526,10 @@
22852527 return $number;
22862528 }
22872529
 2530+ /**
 2531+ * @param $number string
 2532+ * @return string
 2533+ */
22882534 function parseFormattedNumber( $number ) {
22892535 $s = $this->digitTransformTable();
22902536 if ( $s ) {
@@ -2309,10 +2555,16 @@
23102556 return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) );
23112557 }
23122558
 2559+ /**
 2560+ * @return array
 2561+ */
23132562 function digitTransformTable() {
23142563 return self::$dataCache->getItem( $this->mCode, 'digitTransformTable' );
23152564 }
23162565
 2566+ /**
 2567+ * @return array
 2568+ */
23172569 function separatorTransformTable() {
23182570 return self::$dataCache->getItem( $this->mCode, 'separatorTransformTable' );
23192571 }
@@ -2607,8 +2859,17 @@
26082860 return $ret;
26092861 }
26102862
2611 - // truncateHtml() helper function
2612 - // like strcspn() but adds the skipped chars to $ret
 2863+ /**
 2864+ * truncateHtml() helper function
 2865+ * like strcspn() but adds the skipped chars to $ret
 2866+ *
 2867+ * @param $ret
 2868+ * @param $text
 2869+ * @param $search
 2870+ * @param $start
 2871+ * @param $len
 2872+ * @return int
 2873+ */
26132874 private function truncate_skip( &$ret, $text, $search, $start, $len = null ) {
26142875 if ( $len === null ) {
26152876 $len = -1; // -1 means "no limit" for strcspn
@@ -2669,6 +2930,11 @@
26702931 * but only in (some) interface messages; otherwise default gender is used.
26712932 * If second or third parameter are not specified, masculine is used.
26722933 * These details may be overriden per language.
 2934+ *
 2935+ * @param $gender string
 2936+ * @param $forms array
 2937+ *
 2938+ * @return string
26732939 */
26742940 function gender( $gender, $forms ) {
26752941 if ( !count( $forms ) ) {
@@ -2775,27 +3041,52 @@
27763042 return $text;
27773043 }
27783044
2779 - # convert text to all supported variants
 3045+ /**
 3046+ * convert text to all supported variants
 3047+ *
 3048+ * @param $text string
 3049+ * @return array
 3050+ */
27803051 function autoConvertToAllVariants( $text ) {
27813052 return $this->mConverter->autoConvertToAllVariants( $text );
27823053 }
27833054
2784 - # convert text to different variants of a language.
 3055+ /**
 3056+ * convert text to different variants of a language.
 3057+ *
 3058+ * @param $text string
 3059+ * @return string
 3060+ */
27853061 function convert( $text ) {
27863062 return $this->mConverter->convert( $text );
27873063 }
27883064
2789 - # Convert a Title object to a string in the preferred variant
 3065+
 3066+ /**
 3067+ * Convert a Title object to a string in the preferred variant
 3068+ *
 3069+ * @param $title Title
 3070+ * @return string
 3071+ */
27903072 function convertTitle( $title ) {
27913073 return $this->mConverter->convertTitle( $title );
27923074 }
27933075
2794 - # Check if this is a language with variants
 3076+ /**
 3077+ * Check if this is a language with variants
 3078+ *
 3079+ * @return bool
 3080+ */
27953081 function hasVariants() {
27963082 return sizeof( $this->getVariants() ) > 1;
27973083 }
27983084
2799 - # Put custom tags (e.g. -{ }-) around math to prevent conversion
 3085+ /**
 3086+ * Put custom tags (e.g. -{ }-) around math to prevent conversion
 3087+ *
 3088+ * @param $text string
 3089+ * @return string
 3090+ */
28003091 function armourMath( $text ) {
28013092 return $this->mConverter->armourMath( $text );
28023093 }
@@ -2872,6 +3163,10 @@
28733164 * 'variant' => text in that variant
28743165 *
28753166 * @deprecated since 1.17 Use autoConvertToAllVariants()
 3167+ *
 3168+ * @param $text string
 3169+ *
 3170+ * @return string
28763171 */
28773172 function convertLinkToAllVariants( $text ) {
28783173 return $this->mConverter->convertLinkToAllVariants( $text );
@@ -2903,7 +3198,7 @@
29043199 * various functions in the Parser
29053200 *
29063201 * @param $text String: text to be tagged for no conversion
2907 - * @param $noParse
 3202+ * @param $noParse bool
29083203 * @return string the tagged text
29093204 */
29103205 function markNoConversion( $text, $noParse = false ) {
@@ -2929,11 +3224,16 @@
29303225
29313226 /**
29323227 * Get the RFC 3066 code for this language object
 3228+ *
 3229+ * @return string
29333230 */
29343231 function getCode() {
29353232 return $this->mCode;
29363233 }
29373234
 3235+ /**
 3236+ * @param $code string
 3237+ */
29383238 function setCode( $code ) {
29393239 $this->mCode = $code;
29403240 }
@@ -2994,6 +3294,8 @@
29953295 /**
29963296 * Get the fallback for a given language
29973297 *
 3298+ * @param $code string
 3299+ *
29983300 * @return false|string
29993301 */
30003302 static function getFallbackFor( $code ) {
@@ -3008,6 +3310,10 @@
30093311 /**
30103312 * Get all messages for a given language
30113313 * WARNING: this may take a long time
 3314+ *
 3315+ * @param $code string
 3316+ *
 3317+ * @return array
30123318 */
30133319 static function getMessagesFor( $code ) {
30143320 return self::getLocalisationCache()->getItem( $code, 'messages' );
@@ -3015,11 +3321,20 @@
30163322
30173323 /**
30183324 * Get a message for a given language
 3325+ *
 3326+ * @param $key string
 3327+ * @param $code string
 3328+ *
 3329+ * @return string
30193330 */
30203331 static function getMessageFor( $key, $code ) {
30213332 return self::getLocalisationCache()->getSubitem( $code, 'messages', $key );
30223333 }
30233334
 3335+ /**
 3336+ * @param $talk
 3337+ * @return mixed
 3338+ */
30243339 function fixVariableInNamespace( $talk ) {
30253340 if ( strpos( $talk, '$1' ) === false ) {
30263341 return $talk;
@@ -3037,10 +3352,18 @@
30383353 return str_replace( ' ', '_', $talk );
30393354 }
30403355
 3356+ /**
 3357+ * @param $m string
 3358+ * @return string
 3359+ */
30413360 function replaceGrammarInNamespace( $m ) {
30423361 return $this->convertGrammar( trim( $m[2] ), trim( $m[1] ) );
30433362 }
30443363
 3364+ /**
 3365+ * @throws MWException
 3366+ * @return array
 3367+ */
30453368 static function getCaseMaps() {
30463369 static $wikiUpperChars, $wikiLowerChars;
30473370 if ( isset( $wikiUpperChars ) ) {
@@ -3087,7 +3410,7 @@
30883411
30893412 /**
30903413 * @todo Document
3091 - * @param $seconds String
 3414+ * @param $seconds String
30923415 * @return string
30933416 */
30943417 function formatTimePeriod( $seconds ) {
@@ -3122,6 +3445,10 @@
31233446 }
31243447 }
31253448
 3449+ /**
 3450+ * @param $bps int
 3451+ * @return string
 3452+ */
31263453 function formatBitrate( $bps ) {
31273454 $units = array( 'bps', 'kbps', 'Mbps', 'Gbps' );
31283455 if ( $bps <= 0 ) {
@@ -3172,6 +3499,8 @@
31733500
31743501 /**
31753502 * Get the conversion rule title, if any.
 3503+ *
 3504+ * @return string
31763505 */
31773506 function getConvRuleTitle() {
31783507 return $this->mConverter->getConvRuleTitle();

Status & tagging log