r89117 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89116‎ | r89117 | r89118 >
Date:15:59, 29 May 2011
Author:reedy
Status:deferred
Tags:
Comment:
More documentation!
Modified paths:
  • /trunk/phase3/languages/LanguageConverter.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageIu.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageKaa.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageKk.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageKu.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageMl.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageRu.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageSl.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageSr.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageTi.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageTl.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageTr.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageUk.php (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/LanguageConverter.php
@@ -766,6 +766,8 @@
767767
768768 /**
769769 * Returns language specific hash options.
 770+ *
 771+ * @return string
770772 */
771773 public function getExtraHashOptions() {
772774 $variant = $this->getPreferredVariant();
@@ -870,6 +872,8 @@
871873 * @param $code String: language code
872874 * @param $subpage String: subpage name
873875 * @param $recursive Boolean: parse subpages recursively? Defaults to true.
 876+ *
 877+ * @return array
874878 */
875879 function parseCachedTable( $code, $subpage = '', $recursive = true ) {
876880 static $parsed = array();
@@ -1233,6 +1237,8 @@
12341238
12351239 /**
12361240 * @private
 1241+ *
 1242+ * @return string
12371243 */
12381244 function getRulesDesc() {
12391245 $codesep = $this->mConverter->mDescCodeSep;
@@ -1253,6 +1259,8 @@
12541260 /**
12551261 * Parse rules conversion.
12561262 * @private
 1263+ *
 1264+ * @return string
12571265 */
12581266 function getRuleConvertedStr( $variant ) {
12591267 $bidtable = $this->mBidtable;
@@ -1462,6 +1470,7 @@
14631471
14641472 /**
14651473 * Get display text on markup -{...}-
 1474+ * @return string
14661475 */
14671476 public function getDisplay() {
14681477 return $this->mRuleDisplay;
@@ -1469,6 +1478,7 @@
14701479
14711480 /**
14721481 * Get converted title.
 1482+ * @return string
14731483 */
14741484 public function getTitle() {
14751485 return $this->mRuleTitle;
Index: trunk/phase3/languages/classes/LanguageTi.php
@@ -7,6 +7,11 @@
88 class LanguageTi extends Language {
99 /**
1010 * Use singular form for zero
 11+ *
 12+ * @param $count int
 13+ * @param $forms array
 14+ *
 15+ * @return string
1116 */
1217 function convertPlural( $count, $forms ) {
1318 if ( !count( $forms ) ) { return ''; }
Index: trunk/phase3/languages/classes/LanguageTl.php
@@ -7,6 +7,11 @@
88 class LanguageTl extends Language {
99 /**
1010 * Use singular form for zero
 11+ *
 12+ * @param $count int
 13+ * @param $forms array
 14+ *
 15+ * @return string
1116 */
1217 function convertPlural( $count, $forms ) {
1318 if ( !count( $forms ) ) { return ''; }
Index: trunk/phase3/languages/classes/LanguageTr.php
@@ -12,6 +12,10 @@
1313 */
1414 class LanguageTr extends Language {
1515
 16+ /**
 17+ * @param $string string
 18+ * @return string
 19+ */
1620 function ucfirst ( $string ) {
1721 if ( !empty( $string ) && $string[0] == 'i' ) {
1822 return 'İ' . substr( $string, 1 );
@@ -20,6 +24,10 @@
2125 }
2226 }
2327
 28+ /**
 29+ * @param $string string
 30+ * @return mixed|string
 31+ */
2432 function lcfirst ( $string ) {
2533 if ( !empty( $string ) && $string[0] == 'I' ) {
2634 return 'ı' . substr( $string, 1 );
@@ -28,13 +36,27 @@
2937 }
3038 }
3139
32 - /** @see bug 28040 */
 40+ /**
 41+ * @see bug 28040
 42+ *
 43+ * @param $string string
 44+ * @param $first string
 45+ *
 46+ * @return string
 47+ */
3348 function uc( $string, $first = false ) {
3449 $string = preg_replace( '/i/', 'İ', $string );
3550 return parent::uc( $string, $first );
3651 }
3752
38 - /** @see bug 28040 */
 53+ /**
 54+ * @see bug 28040
 55+ *
 56+ * @param $string string
 57+ * @param $first string
 58+ *
 59+ * @return string
 60+ */
3961 function lc( $string, $first = false ) {
4062 $string = preg_replace( '/I/', 'ı', $string );
4163 return parent::lc( $string, $first );
Index: trunk/phase3/languages/classes/LanguageMl.php
@@ -15,6 +15,10 @@
1616 *
1717 * @todo FIXME: This is language-specific for now only to avoid the negative
1818 * performance impact of enabling it for all languages.
 19+ *
 20+ * @param $s string
 21+ *
 22+ * @return string
1923 */
2024 function normalize( $s ) {
2125 global $wgFixMalayalamUnicode;
Index: trunk/phase3/languages/classes/LanguageIu.php
@@ -128,6 +128,8 @@
129129 /**
130130 * We want our external link captions to be converted in variants,
131131 * so we return the original text instead -{$text}-, except for URLs
 132+ *
 133+ * @return string
132134 */
133135 function markNoConversion( $text, $noParse = false ) {
134136 if ( $noParse || preg_match( "/^https?:\/\/|ftp:\/\/|irc:\/\//", $text ) )
@@ -138,6 +140,8 @@
139141 /**
140142 * An ugly function wrapper for parsing Image titles
141143 * (to prevent image name conversion)
 144+ *
 145+ * @return string
142146 */
143147 function autoConvert( $text, $toVariant = false ) {
144148 global $wgTitle;
@@ -149,7 +153,9 @@
150154 }
151155
152156 /**
153 - * It translates text into variant
 157+ * It translates text into variant
 158+ *
 159+ * @return string
154160 */
155161 function translate( $text, $toVariant ) {
156162 // If $text is empty or only includes spaces, do nothing
Index: trunk/phase3/languages/classes/LanguageUk.php
@@ -86,6 +86,10 @@
8787
8888 /**
8989 * Ukrainian numeric format is "12 345,67" but "1234,56"
 90+ *
 91+ * @param $_ string
 92+ *
 93+ * @return string
9094 */
9195 function commafy( $_ ) {
9296 if ( !preg_match( '/^\-?\d{1,4}(\.\d+)?$/', $_ ) ) {
Index: trunk/phase3/languages/classes/LanguageKaa.php
@@ -10,6 +10,8 @@
1111 # Invoked with {{GRAMMAR:case|word}}
1212 /**
1313 * Cases: genitive, dative, accusative, locative, ablative, comitative + possessive forms
 14+ *
 15+ * @return string
1416 */
1517 function convertGrammar( $word, $case ) {
1618 global $wgGrammarForms;
Index: trunk/phase3/languages/classes/LanguageRu.php
@@ -99,6 +99,10 @@
100100 * Four-digit number should be without group commas (spaces)
101101 * See manual of style at http://ru.wikipedia.org/wiki/Википедия:Оформление_статей
102102 * So "1 234 567", "12 345" but "1234"
 103+ *
 104+ * @param $_ string
 105+ *
 106+ * @return string
103107 */
104108 function commafy( $_ ) {
105109 if ( preg_match( '/^-?\d{1,4}(\.\d*)?$/', $_ ) ) {
Index: trunk/phase3/languages/classes/LanguageKk.php
@@ -234,6 +234,8 @@
235235 /**
236236 * An ugly function wrapper for parsing Image titles
237237 * (to prevent image name conversion)
 238+ *
 239+ * @return string
238240 */
239241 function autoConvert( $text, $toVariant = false ) {
240242 global $wgTitle;
@@ -246,6 +248,8 @@
247249
248250 /**
249251 * It translates text into variant
 252+ *
 253+ * @return string
250254 */
251255 function translate( $text, $toVariant ) {
252256 global $wgLanguageCode;
@@ -340,6 +344,8 @@
341345 /**
342346 * We want our external link captions to be converted in variants,
343347 * so we return the original text instead -{$text}-, except for URLs
 348+ *
 349+ * @return string
344350 */
345351 function markNoConversion( $text, $noParse = false ) {
346352 if ( $noParse || preg_match( "/^https?:\/\/|ftp:\/\/|irc:\/\//", $text ) )
Index: trunk/phase3/languages/classes/LanguageSl.php
@@ -9,6 +9,11 @@
1010 # Invoked with {{GRAMMAR:case|word}}
1111 /**
1212 * Cases: rodilnik, dajalnik, tožilnik, mestnik, orodnik
 13+ *
 14+ * @param $word string
 15+ * @param $case string
 16+ *
 17+ * @return string
1318 */
1419 function convertGrammar( $word, $case ) {
1520 global $wgGrammarForms;
Index: trunk/phase3/languages/classes/LanguageKu.php
@@ -155,6 +155,8 @@
156156 /**
157157 * We want our external link captions to be converted in variants,
158158 * so we return the original text instead -{$text}-, except for URLs
 159+ *
 160+ * @return string
159161 */
160162 function markNoConversion( $text, $noParse = false ) {
161163 if ( $noParse || preg_match( "/^https?:\/\/|ftp:\/\/|irc:\/\//", $text ) )
@@ -165,6 +167,8 @@
166168 /**
167169 * An ugly function wrapper for parsing Image titles
168170 * (to prevent image name conversion)
 171+ *
 172+ * @return string
169173 */
170174 function autoConvert( $text, $toVariant = false ) {
171175 global $wgTitle;
@@ -178,6 +182,8 @@
179183 /**
180184 * It translates text into variant, specials:
181185 * - ommiting roman numbers
 186+ *
 187+ * @return string
182188 */
183189 function translate( $text, $toVariant ) {
184190 /* From Kazakh interface, maybe we need it later
Index: trunk/phase3/languages/classes/LanguageSr.php
@@ -100,6 +100,8 @@
101101 /**
102102 * We want our external link captions to be converted in variants,
103103 * so we return the original text instead -{$text}-, except for URLs
 104+ *
 105+ * @return string
104106 */
105107 function markNoConversion( $text, $noParse = false ) {
106108 if ( $noParse || preg_match( "/^https?:\/\/|ftp:\/\/|irc:\/\//", $text ) )
@@ -110,6 +112,8 @@
111113 /**
112114 * An ugly function wrapper for parsing Image titles
113115 * (to prevent image name conversion)
 116+ *
 117+ * @return string
114118 */
115119 function autoConvert( $text, $toVariant = false ) {
116120 global $wgTitle;
@@ -123,6 +127,8 @@
124128 /**
125129 * It translates text into variant, specials:
126130 * - ommiting roman numbers
 131+ *
 132+ * @return string
127133 */
128134 function translate( $text, $toVariant ) {
129135 $breaks = '[^\w\x80-\xff]';
@@ -154,6 +160,8 @@
155161 *
156162 * @author Nikola Smolenski <smolensk@eunet.rs>
157163 * @since 1.18
 164+ *
 165+ * @return bool
158166 */
159167 public function guessVariant( $text, $variant ) {
160168 $numCyrillic = preg_match_all("/[шђчћжШЂЧЋЖ]/u", $text, $dummy);
@@ -166,9 +174,7 @@
167175 } else {
168176 return false;
169177 }
170 -
171178 }
172 -
173179 }
174180
175181 /**

Status & tagging log