Index: trunk/phase3/languages/classes/LanguageHy.php |
— | — | @@ -6,8 +6,15 @@ |
7 | 7 | * @author Ruben Vardanyan (Me@RubenVardanyan.com) |
8 | 8 | */ |
9 | 9 | class LanguageHy extends Language { |
10 | | - # Convert from the nominative form of a noun to some other case |
11 | | - # Invoked with {{grammar:case|word}} |
| 10 | + |
| 11 | + /** |
| 12 | + * Convert from the nominative form of a noun to some other case |
| 13 | + * Invoked with {{grammar:case|word}} |
| 14 | + * |
| 15 | + * @param $word string |
| 16 | + * @param $case string |
| 17 | + * @return string |
| 18 | + */ |
12 | 19 | function convertGrammar( $word, $case ) { |
13 | 20 | global $wgGrammarForms; |
14 | 21 | if ( isset( $wgGrammarForms['hy'][$case][$word] ) ) { |
Index: trunk/phase3/languages/classes/LanguageTr.php |
— | — | @@ -40,7 +40,7 @@ |
41 | 41 | * @see bug 28040 |
42 | 42 | * |
43 | 43 | * @param $string string |
44 | | - * @param $first string |
| 44 | + * @param $first string|bool |
45 | 45 | * |
46 | 46 | * @return string |
47 | 47 | */ |
— | — | @@ -53,7 +53,7 @@ |
54 | 54 | * @see bug 28040 |
55 | 55 | * |
56 | 56 | * @param $string string |
57 | | - * @param $first string |
| 57 | + * @param $first string|bool |
58 | 58 | * |
59 | 59 | * @return string |
60 | 60 | */ |
Index: trunk/phase3/languages/classes/LanguageEo.php |
— | — | @@ -51,6 +51,10 @@ |
52 | 52 | return parent::iconv( $in, $out, $string ); |
53 | 53 | } |
54 | 54 | |
| 55 | + /** |
| 56 | + * @param $matches array |
| 57 | + * @return string |
| 58 | + */ |
55 | 59 | function strrtuxCallback( $matches ) { |
56 | 60 | static $ux = array ( |
57 | 61 | 'x' => 'xx' , 'X' => 'Xx' , |
— | — | @@ -64,6 +68,10 @@ |
65 | 69 | return strtr( $matches[1], $ux ); |
66 | 70 | } |
67 | 71 | |
| 72 | + /** |
| 73 | + * @param $matches array |
| 74 | + * @return string |
| 75 | + */ |
68 | 76 | function strrtxuCallback( $matches ) { |
69 | 77 | static $xu = array ( |
70 | 78 | 'xx' => 'x' , 'xX' => 'x' , |
— | — | @@ -84,6 +92,10 @@ |
85 | 93 | return strtr( $matches[1], $xu ) . strtr( $matches[2], $xu ); |
86 | 94 | } |
87 | 95 | |
| 96 | + /** |
| 97 | + * @param $s string |
| 98 | + * @return string |
| 99 | + */ |
88 | 100 | function checkTitleEncoding( $s ) { |
89 | 101 | # Check for X-system backwards-compatibility URLs |
90 | 102 | $ishigh = preg_match( '/[\x80-\xff]/', $s ); |
Index: trunk/phase3/languages/classes/LanguageIu.php |
— | — | @@ -17,6 +17,9 @@ |
18 | 18 | */ |
19 | 19 | require_once( dirname( __FILE__ ) . '/../LanguageConverter.php' ); |
20 | 20 | |
| 21 | +/** |
| 22 | + * |
| 23 | + */ |
21 | 24 | class IuConverter extends LanguageConverter { |
22 | 25 | var $mToLatin = array( |
23 | 26 | 'ᐦ' => 'h', 'ᐃ' => 'i', 'ᐄ' => 'ii', 'ᐅ' => 'u', 'ᐆ' => 'uu', 'ᐊ' => 'a', 'ᐋ' => 'aa', |
— | — | @@ -76,11 +79,16 @@ |
77 | 80 | ); |
78 | 81 | } |
79 | 82 | |
80 | | - /* rules should be defined as -{Syllabic | Latin-} -or- |
81 | | - -{code:text | code:text | ...}- |
82 | | - update: delete all rule parsing because it's not used |
83 | | - currently, and just produces a couple of bugs |
84 | | - */ |
| 83 | + /** |
| 84 | + * rules should be defined as -{Syllabic | Latin-} -or- |
| 85 | + * -{code:text | code:text | ...}- |
| 86 | + * update: delete all rule parsing because it's not used |
| 87 | + * currently, and just produces a couple of bugs |
| 88 | + * |
| 89 | + * @param $rule string |
| 90 | + * @param $flags array |
| 91 | + * @return array |
| 92 | + */ |
85 | 93 | function parseManualRule( $rule, $flags = array() ) { |
86 | 94 | if ( in_array( 'T', $flags ) ) { |
87 | 95 | return parent::parseManualRule( $rule, $flags ); |
— | — | @@ -95,7 +103,13 @@ |
96 | 104 | return $carray; |
97 | 105 | } |
98 | 106 | |
99 | | - // Do not convert content on talk pages |
| 107 | + /** |
| 108 | + * Do not convert content on talk pages |
| 109 | + * |
| 110 | + * @param $text string |
| 111 | + * @param $parser Parser |
| 112 | + * @return string |
| 113 | + */ |
100 | 114 | function parserConvert( $text, &$parser ) { |
101 | 115 | if ( is_object( $parser->getTitle() ) && $parser->getTitle()->isTalkPage() ) |
102 | 116 | $this->mDoContentConvert = false; |
— | — | @@ -110,6 +124,10 @@ |
111 | 125 | * - if there is no selected variant, leave the link |
112 | 126 | * names as they were |
113 | 127 | * - do not try to find variants for usernames |
| 128 | + * |
| 129 | + * @param $link string |
| 130 | + * @param $nt Title |
| 131 | + * @param $ignoreOtherCond bool |
114 | 132 | */ |
115 | 133 | function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) { |
116 | 134 | // check for user namespace |
— | — | @@ -129,6 +147,9 @@ |
130 | 148 | * We want our external link captions to be converted in variants, |
131 | 149 | * so we return the original text instead -{$text}-, except for URLs |
132 | 150 | * |
| 151 | + * @param $text string |
| 152 | + * @param $noParse bool |
| 153 | + * |
133 | 154 | * @return string |
134 | 155 | */ |
135 | 156 | function markNoConversion( $text, $noParse = false ) { |
— | — | @@ -141,6 +162,9 @@ |
142 | 163 | * An ugly function wrapper for parsing Image titles |
143 | 164 | * (to prevent image name conversion) |
144 | 165 | * |
| 166 | + * @param $text string |
| 167 | + * @param $toVariant bool |
| 168 | + * |
145 | 169 | * @return string |
146 | 170 | */ |
147 | 171 | function autoConvert( $text, $toVariant = false ) { |
— | — | @@ -155,6 +179,9 @@ |
156 | 180 | /** |
157 | 181 | * It translates text into variant |
158 | 182 | * |
| 183 | + * @param $text string |
| 184 | + * @param $toVariant bool |
| 185 | + * |
159 | 186 | * @return string |
160 | 187 | */ |
161 | 188 | function translate( $text, $toVariant ) { |
Index: trunk/phase3/languages/classes/LanguageUk.php |
— | — | @@ -5,8 +5,15 @@ |
6 | 6 | * @ingroup Language |
7 | 7 | */ |
8 | 8 | class LanguageUk extends Language { |
9 | | - # Convert from the nominative form of a noun to some other case |
10 | | - # Invoked with {{grammar:case|word}} |
| 9 | + |
| 10 | + /** |
| 11 | + * Convert from the nominative form of a noun to some other case |
| 12 | + * Invoked with {{grammar:case|word}} |
| 13 | + * |
| 14 | + * @param $word string |
| 15 | + * @param $case string |
| 16 | + * @return string |
| 17 | + */ |
11 | 18 | function convertGrammar( $word, $case ) { |
12 | 19 | global $wgGrammarForms; |
13 | 20 | if ( isset( $wgGrammarForms['uk'][$case][$word] ) ) { |
Index: trunk/phase3/languages/classes/LanguageKaa.php |
— | — | @@ -11,6 +11,9 @@ |
12 | 12 | /** |
13 | 13 | * Cases: genitive, dative, accusative, locative, ablative, comitative + possessive forms |
14 | 14 | * |
| 15 | + * @param $word string |
| 16 | + * @param $case string |
| 17 | + * |
15 | 18 | * @return string |
16 | 19 | */ |
17 | 20 | function convertGrammar( $word, $case ) { |
— | — | @@ -25,6 +28,8 @@ |
26 | 29 | /** |
27 | 30 | * It fixes issue with ucfirst for transforming 'i' to 'İ' |
28 | 31 | * |
| 32 | + * @param $string string |
| 33 | + * |
29 | 34 | * @return string |
30 | 35 | */ |
31 | 36 | function ucfirst ( $string ) { |
Index: trunk/phase3/languages/classes/LanguageFi.php |
— | — | @@ -8,8 +8,14 @@ |
9 | 9 | */ |
10 | 10 | class LanguageFi extends Language { |
11 | 11 | |
12 | | - # Convert from the nominative form of a noun to some other case |
13 | | - # Invoked with {{GRAMMAR:case|word}} |
| 12 | + /** |
| 13 | + * Convert from the nominative form of a noun to some other case |
| 14 | + * Invoked with {{grammar:case|word}} |
| 15 | + * |
| 16 | + * @param $word string |
| 17 | + * @param $case string |
| 18 | + * @return string |
| 19 | + */ |
14 | 20 | function convertGrammar( $word, $case ) { |
15 | 21 | global $wgGrammarForms; |
16 | 22 | if ( isset( $wgGrammarForms['fi'][$case][$word] ) ) { |
— | — | @@ -55,6 +61,11 @@ |
56 | 62 | return $word; |
57 | 63 | } |
58 | 64 | |
| 65 | + /** |
| 66 | + * @param $str string |
| 67 | + * @param $forContent bool |
| 68 | + * @return string |
| 69 | + */ |
59 | 70 | function translateBlockExpiry( $str, $forContent = false ) { |
60 | 71 | /* |
61 | 72 | 'ago', 'now', 'today', 'this', 'next', |
Index: trunk/phase3/languages/classes/LanguageGan.php |
— | — | @@ -8,6 +8,14 @@ |
9 | 9 | */ |
10 | 10 | class GanConverter extends LanguageConverter { |
11 | 11 | |
| 12 | + /** |
| 13 | + * @param $langobj Language |
| 14 | + * @param $maincode string |
| 15 | + * @param $variants array |
| 16 | + * @param $variantfallbacks array |
| 17 | + * @param $flags array |
| 18 | + * @param $manualLevel array |
| 19 | + */ |
12 | 20 | function __construct( $langobj, $maincode, |
13 | 21 | $variants = array(), |
14 | 22 | $variantfallbacks = array(), |
— | — | @@ -37,14 +45,24 @@ |
38 | 46 | ); |
39 | 47 | } |
40 | 48 | |
41 | | - /* there shouldn't be any latin text in Chinese conversion, so no need |
42 | | - to mark anything. |
43 | | - $noParse is there for compatibility with LanguageConvert::markNoConversion |
| 49 | + /** |
| 50 | + * there shouldn't be any latin text in Chinese conversion, so no need |
| 51 | + * to mark anything. |
| 52 | + * $noParse is there for compatibility with LanguageConvert::markNoConversion |
| 53 | + * |
| 54 | + * @param $text string |
| 55 | + * @param $noParse bool |
| 56 | + * |
| 57 | + * @return string |
44 | 58 | */ |
45 | 59 | function markNoConversion( $text, $noParse = false ) { |
46 | 60 | return $text; |
47 | 61 | } |
48 | 62 | |
| 63 | + /** |
| 64 | + * @param $key string |
| 65 | + * @return String |
| 66 | + */ |
49 | 67 | function convertCategoryKey( $key ) { |
50 | 68 | return $this->autoConvert( $key, 'gan' ); |
51 | 69 | } |
— | — | @@ -80,25 +98,44 @@ |
81 | 99 | $wgHooks['ArticleSaveComplete'][] = $this->mConverter; |
82 | 100 | } |
83 | 101 | |
84 | | - # this should give much better diff info |
| 102 | + /** |
| 103 | + * this should give much better diff info |
| 104 | + * |
| 105 | + * @param $text string |
| 106 | + * @return string |
| 107 | + */ |
85 | 108 | function segmentForDiff( $text ) { |
86 | 109 | return preg_replace( |
87 | 110 | "/([\\xc0-\\xff][\\x80-\\xbf]*)/e", |
88 | 111 | "' ' .\"$1\"", $text ); |
89 | 112 | } |
90 | 113 | |
| 114 | + /** |
| 115 | + * @param $text string |
| 116 | + * @return string |
| 117 | + */ |
91 | 118 | function unsegmentForDiff( $text ) { |
92 | 119 | return preg_replace( |
93 | 120 | "/ ([\\xc0-\\xff][\\x80-\\xbf]*)/e", |
94 | 121 | "\"$1\"", $text ); |
95 | 122 | } |
96 | 123 | |
97 | | - // word segmentation |
| 124 | + /** |
| 125 | + * word segmentation |
| 126 | + * |
| 127 | + * @param $string string |
| 128 | + * @param $autoVariant string |
| 129 | + * @return String |
| 130 | + */ |
98 | 131 | function normalizeForSearch( $string, $autoVariant = 'gan-hans' ) { |
99 | 132 | // LanguageZh::normalizeForSearch |
100 | 133 | return parent::normalizeForSearch( $string, $autoVariant ); |
101 | 134 | } |
102 | 135 | |
| 136 | + /** |
| 137 | + * @param $termsArray array |
| 138 | + * @return array |
| 139 | + */ |
103 | 140 | function convertForSearchResult( $termsArray ) { |
104 | 141 | $terms = implode( '|', $termsArray ); |
105 | 142 | $terms = self::convertDoubleWidth( $terms ); |
Index: trunk/phase3/languages/classes/LanguageDsb.php |
— | — | @@ -6,9 +6,14 @@ |
7 | 7 | */ |
8 | 8 | class LanguageDsb extends Language { |
9 | 9 | |
10 | | - # Convert from the nominative form of a noun to some other case |
11 | | - # Invoked with {{GRAMMAR:case|word}} |
12 | | - |
| 10 | + /** |
| 11 | + * Convert from the nominative form of a noun to some other case |
| 12 | + * Invoked with {{grammar:case|word}} |
| 13 | + * |
| 14 | + * @param $word string |
| 15 | + * @param $case string |
| 16 | + * @return string |
| 17 | + */ |
13 | 18 | function convertGrammar( $word, $case ) { |
14 | 19 | global $wgGrammarForms; |
15 | 20 | if ( isset( $wgGrammarForms['dsb'][$case][$word] ) ) { |
Index: trunk/phase3/languages/classes/LanguageHsb.php |
— | — | @@ -6,9 +6,14 @@ |
7 | 7 | |
8 | 8 | class LanguageHsb extends Language { |
9 | 9 | |
10 | | - # Convert from the nominative form of a noun to some other case |
11 | | - # Invoked with {{GRAMMAR:case|word}} |
12 | | - |
| 10 | + /** |
| 11 | + * Convert from the nominative form of a noun to some other case |
| 12 | + * Invoked with {{grammar:case|word}} |
| 13 | + * |
| 14 | + * @param $word string |
| 15 | + * @param $case string |
| 16 | + * @return string |
| 17 | + */ |
13 | 18 | function convertGrammar( $word, $case ) { |
14 | 19 | global $wgGrammarForms; |
15 | 20 | if ( isset( $wgGrammarForms['hsb'][$case][$word] ) ) { |
Index: trunk/phase3/languages/classes/LanguageZh.php |
— | — | @@ -8,6 +8,14 @@ |
9 | 9 | */ |
10 | 10 | class ZhConverter extends LanguageConverter { |
11 | 11 | |
| 12 | + /** |
| 13 | + * @param $langobj Language |
| 14 | + * @param $maincode string |
| 15 | + * @param $variants array |
| 16 | + * @param $variantfallbacks array |
| 17 | + * @param $flags array |
| 18 | + * @param $manualLevel array |
| 19 | + */ |
12 | 20 | function __construct( $langobj, $maincode, |
13 | 21 | $variants = array(), |
14 | 22 | $variantfallbacks = array(), |
— | — | @@ -58,14 +66,24 @@ |
59 | 67 | $this->mTables['zh-tw']->merge( $this->mTables['zh-hant'] ); |
60 | 68 | } |
61 | 69 | |
62 | | - /* there shouldn't be any latin text in Chinese conversion, so no need |
63 | | - to mark anything. |
64 | | - $noParse is there for compatibility with LanguageConvert::markNoConversion |
| 70 | + /** |
| 71 | + * there shouldn't be any latin text in Chinese conversion, so no need |
| 72 | + * to mark anything. |
| 73 | + * $noParse is there for compatibility with LanguageConvert::markNoConversion |
| 74 | + * |
| 75 | + * @param $text string |
| 76 | + * @param $noParse bool |
| 77 | + * |
| 78 | + * @return string |
65 | 79 | */ |
66 | 80 | function markNoConversion( $text, $noParse = false ) { |
67 | 81 | return $text; |
68 | 82 | } |
69 | 83 | |
| 84 | + /** |
| 85 | + * @param $key string |
| 86 | + * @return String |
| 87 | + */ |
70 | 88 | function convertCategoryKey( $key ) { |
71 | 89 | return $this->autoConvert( $key, 'zh' ); |
72 | 90 | } |
— | — | @@ -110,13 +128,22 @@ |
111 | 129 | $wgHooks['ArticleSaveComplete'][] = $this->mConverter; |
112 | 130 | } |
113 | 131 | |
114 | | - # this should give much better diff info |
| 132 | + /** |
| 133 | + * this should give much better diff info |
| 134 | + * |
| 135 | + * @param $text string |
| 136 | + * @return string |
| 137 | + */ |
115 | 138 | function segmentForDiff( $text ) { |
116 | 139 | return preg_replace( |
117 | 140 | "/([\\xc0-\\xff][\\x80-\\xbf]*)/e", |
118 | 141 | "' ' .\"$1\"", $text ); |
119 | 142 | } |
120 | 143 | |
| 144 | + /** |
| 145 | + * @param $text string |
| 146 | + * @return string |
| 147 | + */ |
121 | 148 | function unsegmentForDiff( $text ) { |
122 | 149 | return preg_replace( |
123 | 150 | "/ ([\\xc0-\\xff][\\x80-\\xbf]*)/e", |
— | — | @@ -145,6 +172,10 @@ |
146 | 173 | |
147 | 174 | } |
148 | 175 | |
| 176 | + /** |
| 177 | + * @param $termsArray array |
| 178 | + * @return array |
| 179 | + */ |
149 | 180 | function convertForSearchResult( $termsArray ) { |
150 | 181 | $terms = implode( '|', $termsArray ); |
151 | 182 | $terms = self::convertDoubleWidth( $terms ); |
Index: trunk/phase3/languages/classes/LanguageRu.php |
— | — | @@ -7,8 +7,15 @@ |
8 | 8 | * @ingroup Language |
9 | 9 | */ |
10 | 10 | class LanguageRu extends Language { |
11 | | - # Convert from the nominative form of a noun to some other case |
12 | | - # Invoked with {{grammar:case|word}} |
| 11 | + |
| 12 | + /** |
| 13 | + * Convert from the nominative form of a noun to some other case |
| 14 | + * Invoked with {{grammar:case|word}} |
| 15 | + * |
| 16 | + * @param $word string |
| 17 | + * @param $case string |
| 18 | + * @return string |
| 19 | + */ |
13 | 20 | function convertGrammar( $word, $case ) { |
14 | 21 | global $wgGrammarForms; |
15 | 22 | if ( isset( $wgGrammarForms['ru'][$case][$word] ) ) { |
Index: trunk/phase3/languages/classes/LanguageGa.php |
— | — | @@ -5,8 +5,15 @@ |
6 | 6 | * @ingroup Language |
7 | 7 | */ |
8 | 8 | class LanguageGa extends Language { |
9 | | - # Convert day names |
10 | | - # Invoked with {{GRAMMAR:transformation|word}} |
| 9 | + |
| 10 | + /** |
| 11 | + * Convert day names |
| 12 | + * Invoked with {{GRAMMAR:transformation|word}} |
| 13 | + * |
| 14 | + * @param $word string |
| 15 | + * @param $case string |
| 16 | + * @return string |
| 17 | + */ |
11 | 18 | function convertGrammar( $word, $case ) { |
12 | 19 | global $wgGrammarForms; |
13 | 20 | if ( isset( $wgGrammarForms['ga'][$case][$word] ) ) { |
Index: trunk/phase3/languages/classes/LanguageKk_cyrl.php |
— | — | @@ -236,6 +236,11 @@ |
237 | 237 | return $word; |
238 | 238 | } |
239 | 239 | |
| 240 | + /** |
| 241 | + * @param $word string |
| 242 | + * @param $case string |
| 243 | + * @return string |
| 244 | + */ |
240 | 245 | function convertGrammarKk_latn( $word, $case ) { |
241 | 246 | global $wgGrammarForms; |
242 | 247 | if ( isset( $wgGrammarForms['kk-tr'][$case][$word] ) ) { |
— | — | @@ -456,6 +461,11 @@ |
457 | 462 | return $word; |
458 | 463 | } |
459 | 464 | |
| 465 | + /** |
| 466 | + * @param $word string |
| 467 | + * @param $case string |
| 468 | + * @return string |
| 469 | + */ |
460 | 470 | function convertGrammarKk_arab( $word, $case ) { |
461 | 471 | global $wgGrammarForms; |
462 | 472 | if ( isset( $wgGrammarForms['kk-cn'][$case][$word] ) ) { |
— | — | @@ -676,6 +686,11 @@ |
677 | 687 | return $word; |
678 | 688 | } |
679 | 689 | |
| 690 | + /** |
| 691 | + * @param $word string |
| 692 | + * @param $allVowels array |
| 693 | + * @return array |
| 694 | + */ |
680 | 695 | function lastLetter( $word, $allVowels ) { |
681 | 696 | $lastLetter = array(); |
682 | 697 | |
Index: trunk/phase3/languages/classes/LanguageKk.php |
— | — | @@ -20,6 +20,13 @@ |
21 | 21 | |
22 | 22 | protected $mCyrl2Latn, $mLatn2Cyrl, $mCyLa2Arab; |
23 | 23 | |
| 24 | + /** |
| 25 | + * @param $langobj Language |
| 26 | + * @param $maincode string |
| 27 | + * @param $variants array |
| 28 | + * @param $variantfallbacks array |
| 29 | + * @param $flags array |
| 30 | + */ |
24 | 31 | function __construct( $langobj, $maincode, |
25 | 32 | $variants = array(), |
26 | 33 | $variantfallbacks = array(), |
— | — | @@ -192,11 +199,17 @@ |
193 | 200 | ); |
194 | 201 | } |
195 | 202 | |
196 | | - /* rules should be defined as -{ekavian | iyekavian-} -or- |
197 | | - -{code:text | code:text | ...}- |
198 | | - update: delete all rule parsing because it's not used |
199 | | - currently, and just produces a couple of bugs |
200 | | - */ |
| 203 | + /** |
| 204 | + * rules should be defined as -{ekavian | iyekavian-} -or- |
| 205 | + * -{code:text | code:text | ...}- |
| 206 | + * |
| 207 | + * update: delete all rule parsing because it's not used |
| 208 | + * currently, and just produces a couple of bugs |
| 209 | + * |
| 210 | + * @param $rule string |
| 211 | + * @param $flags array |
| 212 | + * @return array |
| 213 | + */ |
201 | 214 | function parseManualRule( $rule, $flags = array() ) { |
202 | 215 | if ( in_array( 'T', $flags ) ) { |
203 | 216 | return parent::parseManualRule( $rule, $flags ); |
— | — | @@ -216,6 +229,10 @@ |
217 | 230 | * - if there is no selected variant, leave the link |
218 | 231 | * names as they were |
219 | 232 | * - do not try to find variants for usernames |
| 233 | + * |
| 234 | + * @param $link string |
| 235 | + * @param $nt Title |
| 236 | + * @param bool $ignoreOtherCond |
220 | 237 | */ |
221 | 238 | function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) { |
222 | 239 | // check for user namespace |
— | — | @@ -235,6 +252,9 @@ |
236 | 253 | * An ugly function wrapper for parsing Image titles |
237 | 254 | * (to prevent image name conversion) |
238 | 255 | * |
| 256 | + * @param $text string |
| 257 | + * @param $toVariant bool |
| 258 | + * |
239 | 259 | * @return string |
240 | 260 | */ |
241 | 261 | function autoConvert( $text, $toVariant = false ) { |
— | — | @@ -249,6 +269,9 @@ |
250 | 270 | /** |
251 | 271 | * It translates text into variant |
252 | 272 | * |
| 273 | + * @param $text string |
| 274 | + * @param $toVariant string |
| 275 | + * |
253 | 276 | * @return string |
254 | 277 | */ |
255 | 278 | function translate( $text, $toVariant ) { |
— | — | @@ -289,6 +312,11 @@ |
290 | 313 | return $ret; |
291 | 314 | } |
292 | 315 | |
| 316 | + /** |
| 317 | + * @param $text string |
| 318 | + * @param $toVariant string |
| 319 | + * @return mixed|string |
| 320 | + */ |
293 | 321 | function regsConverter( $text, $toVariant ) { |
294 | 322 | if ( $text == '' ) { |
295 | 323 | return $text; |
— | — | @@ -345,6 +373,9 @@ |
346 | 374 | * We want our external link captions to be converted in variants, |
347 | 375 | * so we return the original text instead -{$text}-, except for URLs |
348 | 376 | * |
| 377 | + * @param $text string |
| 378 | + * @param $noParse string|bool |
| 379 | + * |
349 | 380 | * @return string |
350 | 381 | */ |
351 | 382 | function markNoConversion( $text, $noParse = false ) { |
Index: trunk/phase3/languages/classes/LanguageCu.php |
— | — | @@ -5,8 +5,15 @@ |
6 | 6 | * @ingroup Language |
7 | 7 | */ |
8 | 8 | class LanguageCu extends Language { |
9 | | - # Convert from the nominative form of a noun to some other case |
10 | | - # Invoked with {{grammar:case|word}} |
| 9 | + |
| 10 | + /** |
| 11 | + * Convert from the nominative form of a noun to some other case |
| 12 | + * Invoked with {{grammar:case|word}} |
| 13 | + * |
| 14 | + * @param $word string |
| 15 | + * @param $case string |
| 16 | + * @return string |
| 17 | + */ |
11 | 18 | function convertGrammar( $word, $case ) { |
12 | 19 | global $wgGrammarForms; |
13 | 20 | if ( isset( $wgGrammarForms['сu'][$case][$word] ) ) { |
Index: trunk/phase3/languages/classes/LanguageWa.php |
— | — | @@ -24,11 +24,17 @@ |
25 | 25 | return ( $count <= 1 ) ? $forms[0] : $forms[1]; |
26 | 26 | } |
27 | 27 | |
28 | | - ## # |
29 | | - ## # Dates in Walloon are "1î d' <monthname>" for 1st of the month, |
30 | | - ## # "<day> di <monthname>" for months starting by a consoun, and |
31 | | - ## # "<day> d' <monthname>" for months starting with a vowel |
32 | | - ## # |
| 28 | + /** |
| 29 | + * Dates in Walloon are "1î d' <monthname>" for 1st of the month, |
| 30 | + * "<day> di <monthname>" for months starting by a consoun, and |
| 31 | + * "<day> d' <monthname>" for months starting with a vowel |
| 32 | + * |
| 33 | + * @param $ts string |
| 34 | + * @param $adj bool |
| 35 | + * @param $format bool |
| 36 | + * @param $tc bool |
| 37 | + * @return string |
| 38 | + */ |
33 | 39 | function date( $ts, $adj = false, $format = true, $tc = false ) { |
34 | 40 | $ts = wfTimestamp( TS_MW, $ts ); |
35 | 41 | if ( $adj ) { $ts = $this->userAdjust( $ts, $tc ); } |
— | — | @@ -69,6 +75,13 @@ |
70 | 76 | return $d; |
71 | 77 | } |
72 | 78 | |
| 79 | + /** |
| 80 | + * @param $ts string |
| 81 | + * @param $adj bool |
| 82 | + * @param $format bool |
| 83 | + * @param $tc bool |
| 84 | + * @return string |
| 85 | + */ |
73 | 86 | function timeanddate( $ts, $adj = false, $format = true, $tc = false ) { |
74 | 87 | if ( $adj ) { $ts = $this->userAdjust( $ts, $tc ); } |
75 | 88 | $datePreference = $this->dateFormat( $format ); |
Index: trunk/phase3/languages/classes/LanguageKu.php |
— | — | @@ -137,6 +137,10 @@ |
138 | 138 | * - if there is no selected variant, leave the link |
139 | 139 | * names as they were |
140 | 140 | * - do not try to find variants for usernames |
| 141 | + * |
| 142 | + * @param $link string |
| 143 | + * @param $nt Title |
| 144 | + * @param $ignoreOtherCond bool |
141 | 145 | */ |
142 | 146 | function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) { |
143 | 147 | // check for user namespace |
— | — | @@ -156,6 +160,9 @@ |
157 | 161 | * We want our external link captions to be converted in variants, |
158 | 162 | * so we return the original text instead -{$text}-, except for URLs |
159 | 163 | * |
| 164 | + * @param $text string |
| 165 | + * @param $noParse bool |
| 166 | + * |
160 | 167 | * @return string |
161 | 168 | */ |
162 | 169 | function markNoConversion( $text, $noParse = false ) { |
— | — | @@ -168,6 +175,9 @@ |
169 | 176 | * An ugly function wrapper for parsing Image titles |
170 | 177 | * (to prevent image name conversion) |
171 | 178 | * |
| 179 | + * @param $text string |
| 180 | + * @param $toVariant bool |
| 181 | + * |
172 | 182 | * @return string |
173 | 183 | */ |
174 | 184 | function autoConvert( $text, $toVariant = false ) { |
— | — | @@ -183,6 +193,9 @@ |
184 | 194 | * It translates text into variant, specials: |
185 | 195 | * - ommiting roman numbers |
186 | 196 | * |
| 197 | + * @param $text string |
| 198 | + * @param $toVariant bool |
| 199 | + * |
187 | 200 | * @return string |
188 | 201 | */ |
189 | 202 | function translate( $text, $toVariant ) { |
Index: trunk/phase3/languages/classes/LanguageSr.php |
— | — | @@ -58,11 +58,17 @@ |
59 | 59 | ); |
60 | 60 | } |
61 | 61 | |
62 | | - /* rules should be defined as -{ekavian | iyekavian-} -or- |
63 | | - -{code:text | code:text | ...}- |
64 | | - update: delete all rule parsing because it's not used |
65 | | - currently, and just produces a couple of bugs |
66 | | - */ |
| 62 | + /** |
| 63 | + * rules should be defined as -{ekavian | iyekavian-} -or- |
| 64 | + * -{code:text | code:text | ...}- |
| 65 | + * |
| 66 | + * update: delete all rule parsing because it's not used |
| 67 | + * currently, and just produces a couple of bugs |
| 68 | + * |
| 69 | + * @param $rule string |
| 70 | + * @param $flags array |
| 71 | + * @return array |
| 72 | + */ |
67 | 73 | function parseManualRule( $rule, $flags = array() ) { |
68 | 74 | if ( in_array( 'T', $flags ) ) { |
69 | 75 | return parent::parseManualRule( $rule, $flags ); |
— | — | @@ -82,6 +88,10 @@ |
83 | 89 | * - if there is no selected variant, leave the link |
84 | 90 | * names as they were |
85 | 91 | * - do not try to find variants for usernames |
| 92 | + * |
| 93 | + * @param $link string |
| 94 | + * @param $nt Title |
| 95 | + * @param $ignoreOtherCond bool |
86 | 96 | */ |
87 | 97 | function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) { |
88 | 98 | // check for user namespace |
— | — | @@ -101,6 +111,9 @@ |
102 | 112 | * We want our external link captions to be converted in variants, |
103 | 113 | * so we return the original text instead -{$text}-, except for URLs |
104 | 114 | * |
| 115 | + * @param $text string |
| 116 | + * @param $noParse bool |
| 117 | + * |
105 | 118 | * @return string |
106 | 119 | */ |
107 | 120 | function markNoConversion( $text, $noParse = false ) { |
— | — | @@ -113,6 +126,9 @@ |
114 | 127 | * An ugly function wrapper for parsing Image titles |
115 | 128 | * (to prevent image name conversion) |
116 | 129 | * |
| 130 | + * @param $text string |
| 131 | + * @param $toVariant bool |
| 132 | + * |
117 | 133 | * @return string |
118 | 134 | */ |
119 | 135 | function autoConvert( $text, $toVariant = false ) { |
— | — | @@ -128,6 +144,9 @@ |
129 | 145 | * It translates text into variant, specials: |
130 | 146 | * - ommiting roman numbers |
131 | 147 | * |
| 148 | + * @param $text string |
| 149 | + * @param $toVariant string |
| 150 | + * |
132 | 151 | * @return string |
133 | 152 | */ |
134 | 153 | function translate( $text, $toVariant ) { |
— | — | @@ -161,6 +180,9 @@ |
162 | 181 | * @author Nikola Smolenski <smolensk@eunet.rs> |
163 | 182 | * @since 1.18 |
164 | 183 | * |
| 184 | + * @param $text string |
| 185 | + * @param $variant string |
| 186 | + * |
165 | 187 | * @return bool |
166 | 188 | */ |
167 | 189 | public function guessVariant( $text, $variant ) { |