Index: trunk/extensions/Translate/MessageCollection.php |
— | — | @@ -194,6 +194,7 @@ |
195 | 195 | /** |
196 | 196 | * Some statistics scripts for example loop the same collection over every |
197 | 197 | * language. This is a shortcut which keeps tags and definitions. |
| 198 | + * @param $code |
198 | 199 | */ |
199 | 200 | public function resetForNewLanguage( $code ) { |
200 | 201 | $this->code = $code; |
— | — | @@ -209,6 +210,8 @@ |
210 | 211 | |
211 | 212 | /** |
212 | 213 | * For paging messages. One can count messages before and after slice. |
| 214 | + * @param $offset |
| 215 | + * @param $limit |
213 | 216 | */ |
214 | 217 | public function slice( $offset, $limit ) { |
215 | 218 | $this->keys = array_slice( $this->keys, $offset, $limit, true ); |
— | — | @@ -594,20 +597,32 @@ |
595 | 598 | |
596 | 599 | /** |
597 | 600 | * ArrayAccess methods. @{ |
| 601 | + * @param $offset |
598 | 602 | * @return bool |
599 | 603 | */ |
600 | 604 | public function offsetExists( $offset ) { |
601 | 605 | return isset( $this->keys[$offset] ); |
602 | 606 | } |
603 | 607 | |
| 608 | + /** |
| 609 | + * @param $offset |
| 610 | + * @return |
| 611 | + */ |
604 | 612 | public function offsetGet( $offset ) { |
605 | 613 | return $this->messages[$offset]; |
606 | 614 | } |
607 | 615 | |
| 616 | + /** |
| 617 | + * @param $offset |
| 618 | + * @param $value |
| 619 | + */ |
608 | 620 | public function offsetSet( $offset, $value ) { |
609 | 621 | $this->messages[$offset] = $value; |
610 | 622 | } |
611 | 623 | |
| 624 | + /** |
| 625 | + * @param $offset |
| 626 | + */ |
612 | 627 | public function offsetUnset( $offset ) { |
613 | 628 | unset( $this->keys[$offset] ); |
614 | 629 | } |
— | — | @@ -615,6 +630,7 @@ |
616 | 631 | |
617 | 632 | /** |
618 | 633 | * Fail fast if trying to access unknown properties. @{ |
| 634 | + * @param $name |
619 | 635 | */ |
620 | 636 | public function __get( $name ) { |
621 | 637 | throw new MWException( __METHOD__ . ": Trying to access unknown property $name" ); |
Index: trunk/extensions/Translate/scripts/cli.inc |
— | — | @@ -69,6 +69,8 @@ |
70 | 70 | /** |
71 | 71 | * Output a warning message to command line (if available). |
72 | 72 | * @see STDOUT |
| 73 | + * @param $message |
| 74 | + * @param null $channel |
73 | 75 | */ |
74 | 76 | function STDERR( $message, $channel = null ) { |
75 | 77 | STDOUT( $message, $channel, true ); |
Index: trunk/extensions/Translate/scripts/poimport.php |
— | — | @@ -226,6 +226,9 @@ |
227 | 227 | |
228 | 228 | /** |
229 | 229 | * Actually adds the new translation. |
| 230 | + * @param $namespace |
| 231 | + * @param $page |
| 232 | + * @param $text |
230 | 233 | */ |
231 | 234 | private function updateMessage( $namespace, $page, $text ) { |
232 | 235 | $title = Title::makeTitleSafe( $namespace, $page ); |
Index: trunk/extensions/Translate/MessageChecks.php |
— | — | @@ -101,6 +101,7 @@ |
102 | 102 | /** |
103 | 103 | * Adds one tests for this checker. |
104 | 104 | * @see setChecks() |
| 105 | + * @param $check |
105 | 106 | */ |
106 | 107 | public function addCheck( $check ) { |
107 | 108 | if ( is_callable( $check ) ) { |
Index: trunk/extensions/Translate/FFS.php |
— | — | @@ -518,7 +518,7 @@ |
519 | 519 | /** |
520 | 520 | * Message keys format. |
521 | 521 | * |
522 | | - * @param $string |
| 522 | + * @param $key string |
523 | 523 | * |
524 | 524 | * @return string |
525 | 525 | */ |
Index: trunk/extensions/Translate/MessageGroups.php |
— | — | @@ -215,10 +215,16 @@ |
216 | 216 | /** |
217 | 217 | * Returns path to the file where translation of language code $code are. |
218 | 218 | * |
| 219 | + * @param $code |
219 | 220 | * @return Path to the file or false if not applicable. |
220 | 221 | */ |
221 | 222 | public function getMessageFile( $code ) { return false; } |
222 | 223 | public function getPath() { return false; } |
| 224 | + |
| 225 | + /** |
| 226 | + * @param $code |
| 227 | + * @return bool|string |
| 228 | + */ |
223 | 229 | public function getMessageFileWithPath( $code ) { |
224 | 230 | $path = $this->getPath(); |
225 | 231 | $file = $this->getMessageFile( $code ); |
— | — | @@ -467,12 +473,18 @@ |
468 | 474 | /** |
469 | 475 | * Extensions have almost always a localised description message and |
470 | 476 | * address to extension homepage. |
| 477 | + * @param $key |
| 478 | + * @param $url |
471 | 479 | */ |
472 | 480 | public function setDescriptionMsg( $key, $url ) { |
473 | 481 | $this->descriptionKey = $key; |
474 | 482 | $this->descriptionUrl = $url; |
475 | 483 | } |
476 | 484 | |
| 485 | + /** |
| 486 | + * @param $key |
| 487 | + * @param $url |
| 488 | + */ |
477 | 489 | protected function setDescriptionMsgReal( $key, $url ) { |
478 | 490 | $this->description = ''; |
479 | 491 | |
— | — | @@ -1158,6 +1170,10 @@ |
1159 | 1171 | /** |
1160 | 1172 | * Function do do $array[level1][level2]...[levelN][$key] = $value, if we have |
1161 | 1173 | * the indexes in an array. |
| 1174 | + * @param $array |
| 1175 | + * @param $indexes array |
| 1176 | + * @param $key |
| 1177 | + * @param $value |
1162 | 1178 | */ |
1163 | 1179 | public static function deepArraySet( &$array, array $indexes, $key, $value ) { |
1164 | 1180 | foreach ( $indexes as $index ) { |
Index: trunk/extensions/Translate/tag/TranslatablePage.php |
— | — | @@ -434,6 +434,7 @@ |
435 | 435 | * Adds a tag which indicates that this page is |
436 | 436 | * suitable for translation. |
437 | 437 | * @param $revision integer |
| 438 | + * @param null $value |
438 | 439 | */ |
439 | 440 | public function addMarkedTag( $revision, $value = null ) { |
440 | 441 | $this->addTag( 'tp:mark', $revision, $value ); |
Index: trunk/extensions/Translate/tag/TPParse.php |
— | — | @@ -224,6 +224,8 @@ |
225 | 225 | * Replaces variables from given text. |
226 | 226 | * @todo Is plain str_replace not enough (even the loop is not needed)? |
227 | 227 | * |
| 228 | + * @param $variables array |
| 229 | + * @param $text string |
228 | 230 | * @return string |
229 | 231 | */ |
230 | 232 | protected static function replaceVariables( $variables, $text ) { |
Index: trunk/extensions/Translate/tag/PageTranslationHooks.php |
— | — | @@ -100,16 +100,15 @@ |
101 | 101 | } |
102 | 102 | |
103 | 103 | /** |
104 | | - * @static |
105 | 104 | * @param $article Article |
106 | 105 | * @param $user User |
107 | | - * @param $text |
108 | | - * @param $summary |
109 | | - * @param $minor |
110 | | - * @param $_ |
111 | | - * @param $_ |
112 | | - * @param $flags |
113 | | - * @param $revision |
| 106 | + * @param $text |
| 107 | + * @param $summary |
| 108 | + * @param $minor |
| 109 | + * @param $_ |
| 110 | + * @param $_ |
| 111 | + * @param $flags |
| 112 | + * @param $revision |
114 | 113 | * @return bool |
115 | 114 | */ |
116 | 115 | public static function onSectionSave( $article, $user, $text, $summary, $minor, |
Index: trunk/extensions/Translate/tag/MoveJob.php |
— | — | @@ -168,6 +168,7 @@ |
169 | 169 | |
170 | 170 | /** |
171 | 171 | * Adapted from wfSuppressWarnings to allow not leaving redirects. |
| 172 | + * @param $end bool |
172 | 173 | */ |
173 | 174 | public static function forceRedirects( $end = false ) { |
174 | 175 | static $suppressCount = 0; |
Index: trunk/extensions/Translate/utils/MessageHandle.php |
— | — | @@ -22,8 +22,7 @@ |
23 | 23 | |
24 | 24 | /** |
25 | 25 | * Check if a title is in a message namespace. |
26 | | - * @param $title Title |
27 | | - * @return \bool If title is in a message namespace. |
| 26 | + * @return bool If title is in a message namespace. |
28 | 27 | */ |
29 | 28 | public function isMessageNamespace() { |
30 | 29 | global $wgTranslateMessageNamespaces; |
— | — | @@ -111,8 +110,7 @@ |
112 | 111 | |
113 | 112 | /** |
114 | 113 | * Check if a title is marked as fuzzy. |
115 | | - * @param $title Title |
116 | | - * @return \bool If title is marked fuzzy. |
| 114 | + * @return bool If title is marked fuzzy. |
117 | 115 | */ |
118 | 116 | public function isFuzzy() { |
119 | 117 | $dbr = wfGetDB( DB_SLAVE ); |
Index: trunk/extensions/Translate/utils/UserToggles.php |
— | — | @@ -17,11 +17,14 @@ |
18 | 18 | * Add 'translate-pref-nonewsletter' preference. |
19 | 19 | * This is actually specific to translatewiki.net |
20 | 20 | * |
21 | | - * @return \bool true |
| 21 | + * @param $user User |
| 22 | + * @param $preferences array |
| 23 | + * @return bool true |
22 | 24 | */ |
23 | 25 | public static function onGetPreferences( $user, &$preferences ) { |
24 | 26 | global $wgEnableEmail, $wgUser, $wgEnotifRevealEditorAddress; |
25 | 27 | |
| 28 | + // TODO: Shouldn't we use $user here? |
26 | 29 | // Only show is e-mail is enabled and user has a confirmed e-mail address. |
27 | 30 | if ( $wgEnableEmail && $wgUser->isEmailConfirmed() ) { |
28 | 31 | // 'translate-pref-nonewsletter' is used as opt-out for |
Index: trunk/extensions/Translate/utils/MessageWebImporter.php |
— | — | @@ -76,6 +76,7 @@ |
77 | 77 | |
78 | 78 | /** |
79 | 79 | * Group is either MessageGroup object or group id. |
| 80 | + * @param $group MessagerGroup|string |
80 | 81 | */ |
81 | 82 | public function setGroup( $group ) { |
82 | 83 | if ( $group instanceof MessageGroup ) { |
— | — | @@ -93,10 +94,16 @@ |
94 | 95 | $this->code = $code; |
95 | 96 | } |
96 | 97 | |
| 98 | + /** |
| 99 | + * @return String |
| 100 | + */ |
97 | 101 | protected function getAction() { |
98 | 102 | return $this->getTitle()->getFullURL(); |
99 | 103 | } |
100 | 104 | |
| 105 | + /** |
| 106 | + * @return string |
| 107 | + */ |
101 | 108 | protected function doHeader() { |
102 | 109 | global $wgOut; |
103 | 110 | $wgOut->addModules( 'ext.translate' ); |
— | — | @@ -114,10 +121,16 @@ |
115 | 122 | Html::hidden( 'process', 1 ); |
116 | 123 | } |
117 | 124 | |
| 125 | + /** |
| 126 | + * @return string |
| 127 | + */ |
118 | 128 | protected function doFooter() { |
119 | 129 | return '</form>'; |
120 | 130 | } |
121 | 131 | |
| 132 | + /** |
| 133 | + * @return bool |
| 134 | + */ |
122 | 135 | protected function allowProcess() { |
123 | 136 | global $wgRequest; |
124 | 137 | |
— | — | @@ -130,6 +143,9 @@ |
131 | 144 | return false; |
132 | 145 | } |
133 | 146 | |
| 147 | + /** |
| 148 | + * @return array |
| 149 | + */ |
134 | 150 | protected function getActions() { |
135 | 151 | if ( $this->code === 'en' ) { |
136 | 152 | return array( 'import', 'fuzzy', 'ignore' ); |
— | — | @@ -138,6 +154,11 @@ |
139 | 155 | } |
140 | 156 | } |
141 | 157 | |
| 158 | + /** |
| 159 | + * @param $fuzzy bool |
| 160 | + * @param $action |
| 161 | + * @return string |
| 162 | + */ |
142 | 163 | protected function getDefaultAction( $fuzzy, $action ) { |
143 | 164 | if ( $action ) { |
144 | 165 | return $action; |
— | — | @@ -511,7 +532,7 @@ |
512 | 533 | * Prepends translation with fuzzy tag and ensures there is only one of them. |
513 | 534 | * |
514 | 535 | * @param $message String: message content |
515 | | - * @return $message \string Message prefixed with TRANSLATE_FUZZY tag |
| 536 | + * @return string Message prefixed with TRANSLATE_FUZZY tag |
516 | 537 | */ |
517 | 538 | public static function makeTextFuzzy( $message ) { |
518 | 539 | $message = str_replace( TRANSLATE_FUZZY, '', $message ); |
Index: trunk/extensions/Translate/utils/StatsTable.php |
— | — | @@ -193,7 +193,7 @@ |
194 | 194 | * Gets the name of group linked to translation tool. |
195 | 195 | * @param $group MessageGroup |
196 | 196 | * @param $code string Language code |
197 | | - * @param $paras array Any extra query parameters. |
| 197 | + * @param $params array Any extra query parameters. |
198 | 198 | * @return string Html |
199 | 199 | */ |
200 | 200 | public function makeGroupLink( MessageGroup $group, $code, $params ) { |
Index: trunk/extensions/Translate/utils/StringMatcher.php |
— | — | @@ -68,7 +68,7 @@ |
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
72 | | - * Cosntructor, see EmptyMatcher(); |
| 72 | + * Constructor, see EmptyMatcher(); |
73 | 73 | */ |
74 | 74 | public function __construct( $prefix = '', $patterns = array() ) { |
75 | 75 | $this->sPrefix = $prefix; |
Index: trunk/extensions/Translate/utils/MessageIndex.php |
— | — | @@ -73,6 +73,8 @@ |
74 | 74 | |
75 | 75 | /** |
76 | 76 | * Purge message group stats when set of keys have changed. |
| 77 | + * @param $old array |
| 78 | + * @param $new array |
77 | 79 | */ |
78 | 80 | protected function clearMessageGroupStats( array $old, array $new ) { |
79 | 81 | $changes = array(); |
— | — | @@ -87,6 +89,11 @@ |
88 | 90 | MessageGroupStats::clearGroup( array_keys( $changes ) ); |
89 | 91 | } |
90 | 92 | |
| 93 | + /** |
| 94 | + * @param $hugearray array |
| 95 | + * @param $g |
| 96 | + * @param $ignore bool |
| 97 | + */ |
91 | 98 | protected function checkAndAdd( &$hugearray, $g, $ignore = false ) { |
92 | 99 | if ( $g instanceof MessageGroupBase ) { |
93 | 100 | $cache = new MessageGroupCache( $g ); |
Index: trunk/extensions/Translate/utils/MessageGroupStats.php |
— | — | @@ -68,7 +68,7 @@ |
69 | 69 | |
70 | 70 | /** |
71 | 71 | * Returns stats for all languages in given group. |
72 | | - * @param $code string Group id |
| 72 | + * @param $id string Group id |
73 | 73 | * @return Array |
74 | 74 | */ |
75 | 75 | public static function forGroup( $id ) { |
— | — | @@ -154,6 +154,7 @@ |
155 | 155 | |
156 | 156 | /** |
157 | 157 | * Returns an array of needed database fields. |
| 158 | + * @param $row |
158 | 159 | * @return array |
159 | 160 | */ |
160 | 161 | protected static function extractNumbers( $row ) { |
Index: trunk/extensions/Translate/utils/TranslationHelpers.php |
— | — | @@ -194,6 +194,7 @@ |
195 | 195 | * Returns block element HTML snippet that contains the translation aids. |
196 | 196 | * Not all boxes are shown all the time depending on whether they have |
197 | 197 | * any information to show and on configuration variables. |
| 198 | + * @param $suggestions string |
198 | 199 | * @return String. Block level HTML snippet or empty string. |
199 | 200 | */ |
200 | 201 | public function getBoxes( $suggestions = 'sync' ) { |
— | — | @@ -244,7 +245,9 @@ |
245 | 246 | |
246 | 247 | /** |
247 | 248 | * Returns suggestions from a translation memory. |
248 | | - * @return Html snippet which contains the suggestions. |
| 249 | + * @param $serviceName |
| 250 | + * @param $config |
| 251 | + * @return string Html snippet which contains the suggestions. |
249 | 252 | */ |
250 | 253 | protected function getTmBox( $serviceName, $config ) { |
251 | 254 | if ( !$this->targetLanguage ) { |
— | — | @@ -1230,7 +1233,9 @@ |
1231 | 1234 | } |
1232 | 1235 | |
1233 | 1236 | /** |
1234 | | - * Increases the failure count for a given service */ |
| 1237 | + * Increases the failure count for a given service |
| 1238 | + * @param $service |
| 1239 | + */ |
1235 | 1240 | public static function reportTranslationServiceFailure( $service ) { |
1236 | 1241 | global $wgMemc; |
1237 | 1242 | |
Index: trunk/extensions/Translate/utils/MessageGroupCache.php |
— | — | @@ -68,7 +68,8 @@ |
69 | 69 | |
70 | 70 | /** |
71 | 71 | * Get an item from the cache. |
72 | | - * @return \string |
| 72 | + * @param $key |
| 73 | + * @return string |
73 | 74 | */ |
74 | 75 | public function get( $key ) { |
75 | 76 | return $this->open()->get( $key ); |
— | — | @@ -225,6 +226,7 @@ |
226 | 227 | |
227 | 228 | /** |
228 | 229 | * Updates cache to cache format 2. |
| 230 | + * @param $oldcache CdbReader |
229 | 231 | */ |
230 | 232 | protected function updateCacheFormat( $oldcache ) { |
231 | 233 | // Read the data from the old format |
Index: trunk/extensions/Translate/RcFilter.php |
— | — | @@ -64,7 +64,9 @@ |
65 | 65 | * documentation of the function parameters. |
66 | 66 | * |
67 | 67 | * Adds a HTMl selector into $items |
68 | | - * @return \bool true |
| 68 | + * @param $items |
| 69 | + * @param $opts |
| 70 | + * @return bool true |
69 | 71 | */ |
70 | 72 | public static function translationFilterForm( &$items, $opts ) { |
71 | 73 | $opts->consumeValue( 'translations' ); |
Index: trunk/extensions/Translate/specials/SpecialManageGroups.php |
— | — | @@ -184,6 +184,7 @@ |
185 | 185 | * @todo Very long code block; split up. |
186 | 186 | * |
187 | 187 | * @param $group MessageGroup |
| 188 | + * @param $code |
188 | 189 | */ |
189 | 190 | public function importForm( $group, $code ) { |
190 | 191 | $this->setSubtitle( $group, $code ); |
Index: trunk/extensions/Translate/specials/SpecialTranslationStats.php |
— | — | @@ -211,7 +211,7 @@ |
212 | 212 | |
213 | 213 | /** |
214 | 214 | * Constructs a table row with label and radio input in two columns. |
215 | | - * @param $name Option name. |
| 215 | + * @param $name string Option name. |
216 | 216 | * @param $opts FormOptions |
217 | 217 | * @param $alts \list{String} List of alternatives. |
218 | 218 | * @return \string Html. |
Index: trunk/extensions/Translate/Groups.php |
— | — | @@ -88,6 +88,7 @@ |
89 | 89 | /** |
90 | 90 | * Initialises a message collection with the given language code, |
91 | 91 | * message definitions and message tags. |
| 92 | + * @param $code |
92 | 93 | * @return MessageCollection |
93 | 94 | */ |
94 | 95 | public function initCollection( $code ); |
— | — | @@ -97,6 +98,7 @@ |
98 | 99 | * that list may be identical with the translation in the wiki. For other |
99 | 100 | * groups the messages may be loaded from a file (and differ from the |
100 | 101 | * current translations or definitions). |
| 102 | + * @param $code |
101 | 103 | * @return array |
102 | 104 | */ |
103 | 105 | public function load( $code ); |
— | — | @@ -104,6 +106,7 @@ |
105 | 107 | /** |
106 | 108 | * Returns message tags. If type is given, only messages keys with that |
107 | 109 | * tag is returnted. Otherwise an array[tag => keys] is returnted. |
| 110 | + * @param null $type |
108 | 111 | * @return array |
109 | 112 | */ |
110 | 113 | public function getTags( $type = null ); |
— | — | @@ -112,6 +115,8 @@ |
113 | 116 | * Returns the definition or translation for given message key in given |
114 | 117 | * language code. |
115 | 118 | * @todo Is this needed in the interface? |
| 119 | + * @param $key |
| 120 | + * @param $code |
116 | 121 | * @return string or null |
117 | 122 | */ |
118 | 123 | public function getMessage( $key, $code ); |
Index: trunk/extensions/Translate/ffs/MediaWikiComplexMessages.php |
— | — | @@ -124,6 +124,7 @@ |
125 | 125 | /** |
126 | 126 | * Gets data from request. Needs to be run before the form is displayed and |
127 | 127 | * validation. Not needed for export, which uses request directly. |
| 128 | + * @param $request WebRequest |
128 | 129 | */ |
129 | 130 | public function loadFromRequest( WebRequest $request ) { |
130 | 131 | $saved = $this->parse( $this->formatForSave( $request ) ); |
— | — | @@ -172,6 +173,7 @@ |
173 | 174 | |
174 | 175 | /** |
175 | 176 | * Return an array of keys that can be used to iterate over all keys |
| 177 | + * @param $group |
176 | 178 | * @return Array of keys for data |
177 | 179 | */ |
178 | 180 | protected function getIterator( $group ) { |
Index: trunk/extensions/Translate/ffs/Xliff.php |
— | — | @@ -35,6 +35,9 @@ |
36 | 36 | |
37 | 37 | /** |
38 | 38 | * Writes very minimalistic header that validates XLIFF schema. |
| 39 | + * @param $w XMLWriter |
| 40 | + * @param $handle |
| 41 | + * @param $code |
39 | 42 | */ |
40 | 43 | protected function header( XMLWriter $w, $handle, $code ) { |
41 | 44 | $w->startDocument( '1.0', 'UTF-8' ); |
— | — | @@ -61,6 +64,9 @@ |
62 | 65 | /** |
63 | 66 | * Exports the messages to XLIFF trans-units. |
64 | 67 | * TODO: Add more information like provided in the web interface. |
| 68 | + * @param $w XMLWriter |
| 69 | + * @param $handle |
| 70 | + * @param $collection MessageCollection |
65 | 71 | */ |
66 | 72 | protected function messages( XMLWriter $w, $handle, MessageCollection $collection ) { |
67 | 73 | $w->startElement( 'body' ); |
— | — | @@ -82,6 +88,9 @@ |
83 | 89 | |
84 | 90 | /** |
85 | 91 | * Ends the XLIFF document |
| 92 | + * @param $w XMLWriter |
| 93 | + * @param $handle |
| 94 | + * @param $code |
86 | 95 | */ |
87 | 96 | protected function footer( XMLWriter $w, $handle, $code ) { |
88 | 97 | $w->endElement(); // </file> |