Index: trunk/phase3/includes/Cdb.php |
— | — | @@ -72,7 +72,7 @@ |
73 | 73 | * |
74 | 74 | * @param $fileName string |
75 | 75 | * |
76 | | - * @return bool |
| 76 | + * @return CdbWriter_DBA|CdbWriter_PHP |
77 | 77 | */ |
78 | 78 | public static function open( $fileName ) { |
79 | 79 | if ( CdbReader::haveExtension() ) { |
Index: trunk/extensions/Translate/tag/TranslatablePage.php |
— | — | @@ -25,6 +25,8 @@ |
26 | 26 | |
27 | 27 | /** |
28 | 28 | * Revision of the page, if applicaple. |
| 29 | + * |
| 30 | + * @var int |
29 | 31 | */ |
30 | 32 | protected $revision = null; |
31 | 33 | |
— | — | @@ -183,7 +185,7 @@ |
184 | 186 | /** |
185 | 187 | * Returns MessageGroup used for translating this page. It may still be empty |
186 | 188 | * if the page has not been ever marked. |
187 | | - * @return \type{WikiPageMessageGroup} |
| 189 | + * @return WikiPageMessageGroup |
188 | 190 | */ |
189 | 191 | public function getMessageGroup() { |
190 | 192 | return MessageGroups::getGroup( $this->getMessageGroupId() ); |
— | — | @@ -297,6 +299,11 @@ |
298 | 300 | |
299 | 301 | // Inner functionality // |
300 | 302 | |
| 303 | + /** |
| 304 | + * @param $holders |
| 305 | + * @param $text |
| 306 | + * @return mixed |
| 307 | + */ |
301 | 308 | public static function armourNowiki( &$holders, $text ) { |
302 | 309 | $re = '~(<nowiki>)(.*?)(</nowiki>)~s'; |
303 | 310 | |
— | — | @@ -309,6 +316,11 @@ |
310 | 317 | return $text; |
311 | 318 | } |
312 | 319 | |
| 320 | + /** |
| 321 | + * @param $holders |
| 322 | + * @param $text |
| 323 | + * @return mixed |
| 324 | + */ |
313 | 325 | public static function unArmourNowiki( $holders, $text ) { |
314 | 326 | foreach ( $holders as $ph => $value ) { |
315 | 327 | $text = str_replace( $ph, $value, $text ); |
— | — | @@ -500,7 +512,11 @@ |
501 | 513 | unset( self::$tagCache[$aid] ); |
502 | 514 | } |
503 | 515 | |
504 | | - /// @return false if tag is not found |
| 516 | + /** |
| 517 | + * @param $tag |
| 518 | + * @param $dbt int |
| 519 | + * @return array|bool false if tag is not found |
| 520 | + */ |
505 | 521 | protected function getTag( $tag, $dbt = DB_SLAVE ) { |
506 | 522 | if ( !$this->getTitle()->exists() ) { |
507 | 523 | return false; |
— | — | @@ -530,6 +546,10 @@ |
531 | 547 | } |
532 | 548 | } |
533 | 549 | |
| 550 | + /** |
| 551 | + * @param $code bool|string |
| 552 | + * @return String |
| 553 | + */ |
534 | 554 | public function getTranslationUrl( $code = false ) { |
535 | 555 | $translate = SpecialPage::getTitleFor( 'Translate' ); |
536 | 556 | $params = array( |
— | — | @@ -628,6 +648,11 @@ |
629 | 649 | return $temp; |
630 | 650 | } |
631 | 651 | |
| 652 | + /** |
| 653 | + * @param $collection MessageCollection |
| 654 | + * @param $markedRevs |
| 655 | + * @return float|int |
| 656 | + */ |
632 | 657 | protected function getPercentageInternal( $collection, $markedRevs ) { |
633 | 658 | $count = count( $collection ); |
634 | 659 | if ( $count === 0 ) { |
— | — | @@ -687,6 +712,10 @@ |
688 | 713 | return $db->selectField( 'revtag', $fields, $conds, __METHOD__, $options ); |
689 | 714 | } |
690 | 715 | |
| 716 | + /** |
| 717 | + * @param $title Title |
| 718 | + * @return bool|TranslatablePage |
| 719 | + */ |
691 | 720 | public static function isTranslationPage( Title $title ) { |
692 | 721 | list( $key, $code ) = TranslateUtils::figureMessage( $title->getText() ); |
693 | 722 | |
— | — | @@ -721,6 +750,10 @@ |
722 | 751 | return Title::makeTitleSafe( $title->getNamespace(), $text ); |
723 | 752 | } |
724 | 753 | |
| 754 | + /** |
| 755 | + * @param $title Title |
| 756 | + * @return bool |
| 757 | + */ |
725 | 758 | public static function isSourcePage( Title $title ) { |
726 | 759 | static $cache = null; |
727 | 760 | |
Index: trunk/extensions/Translate/tag/RenderJob.php |
— | — | @@ -93,7 +93,7 @@ |
94 | 94 | } |
95 | 95 | |
96 | 96 | /** |
97 | | - * @param $user User |
| 97 | + * @param $user User|string |
98 | 98 | */ |
99 | 99 | public function setUser( $user ) { |
100 | 100 | if ( $user instanceof User ) { |
Index: trunk/extensions/Translate/tag/SpecialPageTranslation.php |
— | — | @@ -53,7 +53,6 @@ |
54 | 54 | // Check permissions |
55 | 55 | if ( !$this->user->isAllowed( 'pagetranslation' ) ) { |
56 | 56 | $wgOut->permissionRequired( 'pagetranslation' ); |
57 | | - |
58 | 57 | return; |
59 | 58 | } |
60 | 59 | |
— | — | @@ -252,6 +251,12 @@ |
253 | 252 | } |
254 | 253 | } |
255 | 254 | |
| 255 | + /** |
| 256 | + * @param $title Title |
| 257 | + * @param $rev |
| 258 | + * @param $latest |
| 259 | + * @param string $old |
| 260 | + */ |
256 | 261 | protected function actionLinks( $title, $rev, $latest, $old = 'old' ) { |
257 | 262 | $actions = array(); |
258 | 263 | |
— | — | @@ -351,7 +356,11 @@ |
352 | 357 | return $sections; |
353 | 358 | } |
354 | 359 | |
355 | | - /** Displays the sections and changes for the user to review */ |
| 360 | + /** |
| 361 | + * Displays the sections and changes for the user to review |
| 362 | + * @param $page TranslatablePage |
| 363 | + * @param $sections array |
| 364 | + */ |
356 | 365 | public function showPage( TranslatablePage $page, Array $sections ) { |
357 | 366 | global $wgOut, $wgContLang; |
358 | 367 | |
— | — | @@ -548,6 +557,10 @@ |
549 | 558 | return false; |
550 | 559 | } |
551 | 560 | |
| 561 | + /** |
| 562 | + * @param $page Article |
| 563 | + * @param $changed |
| 564 | + */ |
552 | 565 | public function addFuzzyTags( $page, $changed ) { |
553 | 566 | if ( !count( $changed ) ) { |
554 | 567 | self::superDebug( __METHOD__, 'nochanged', $page->getTitle() ); |
— | — | @@ -613,6 +626,8 @@ |
614 | 627 | * If this page is marked for the first time, /en may not yet exists. |
615 | 628 | * If this is the case, add a RenderJob for it, but don't execute it |
616 | 629 | * immediately, since the message group doesn't exist during this request. |
| 630 | + * @param $page Article |
| 631 | + * @param $titles array |
617 | 632 | */ |
618 | 633 | protected function addInitialRenderJob( $page, $titles ) { |
619 | 634 | global $wgContLang; |
Index: trunk/extensions/Translate/tag/SpecialPageTranslationDeletePage.php |
— | — | @@ -33,8 +33,9 @@ |
34 | 34 | /// Allow skipping non-translation subpages. |
35 | 35 | protected $doSubpages = false; |
36 | 36 | |
37 | | - |
38 | | - /// TranslatablePage instance. |
| 37 | + /** |
| 38 | + * @var TranslatablePage |
| 39 | + */ |
39 | 40 | protected $page; |
40 | 41 | /// Contains the language code if we are working with translation page |
41 | 42 | protected $code; |
— | — | @@ -262,6 +263,10 @@ |
263 | 264 | $wgOut->addHTML( implode( "\n", $form ) ); |
264 | 265 | } |
265 | 266 | |
| 267 | + /** |
| 268 | + * @param $title Title |
| 269 | + * @param $enabled bool |
| 270 | + */ |
266 | 271 | protected function printChangeLine( $title, $enabled = true ) { |
267 | 272 | global $wgOut; |
268 | 273 | if ( $enabled ) { |
— | — | @@ -361,6 +366,9 @@ |
362 | 367 | return $this->title->getSubpages(); |
363 | 368 | } |
364 | 369 | |
| 370 | + /** |
| 371 | + * @return bool |
| 372 | + */ |
365 | 373 | protected function singleLanguage() { |
366 | 374 | return $this->code !== ''; |
367 | 375 | } |
Index: trunk/extensions/Translate/tag/SpecialPageTranslationMovePage.php |
— | — | @@ -47,7 +47,7 @@ |
48 | 48 | |
49 | 49 | |
50 | 50 | /** |
51 | | - * TranslatablePage instance. |
| 51 | + * @var TranslatablePage instance. |
52 | 52 | */ |
53 | 53 | protected $page; |
54 | 54 | |
— | — | @@ -324,6 +324,12 @@ |
325 | 325 | $wgOut->addHTML( implode( "\n", $form ) ); |
326 | 326 | } |
327 | 327 | |
| 328 | + /** |
| 329 | + * @param $base |
| 330 | + * @param $old Title |
| 331 | + * @param $target |
| 332 | + * @param bool $enabled |
| 333 | + */ |
328 | 334 | protected function printChangeLine( $base, $old, $target, $enabled = true ) { |
329 | 335 | global $wgOut; |
330 | 336 | |
Index: trunk/extensions/Translate/utils/Html.php |
— | — | @@ -59,7 +59,7 @@ |
60 | 60 | * Sets the tag content. Chain-accessor. |
61 | 61 | * |
62 | 62 | * @param $value \mixed Optional. Null to view and string to set the content. |
63 | | - * @return \mixed The content as a string or self. |
| 63 | + * @return HtmlTag|string The content as a string or self. |
64 | 64 | */ |
65 | 65 | public function content( $value = null ) { |
66 | 66 | if ( $value === null ) { |
— | — | @@ -120,7 +120,7 @@ |
121 | 121 | * |
122 | 122 | * @param $name \string The name of the parameter. |
123 | 123 | * @param $value \mixed Optional. False to unset, null to view and string to set the value. |
124 | | - * @return \mixed The value of the parameter or null if not set. |
| 124 | + * @return null|HtmlTag The value of the parameter or null if not set. |
125 | 125 | */ |
126 | 126 | public function style( $name, $value = null ) { |
127 | 127 | $name = (string) $this->assert( 'is_string', $name ); |
Index: trunk/extensions/Translate/specials/SpecialManageGroups.php |
— | — | @@ -18,7 +18,21 @@ |
19 | 19 | * messages, as well as import/update of messages in other languages. |
20 | 20 | */ |
21 | 21 | class SpecialManageGroups extends SpecialPage { |
22 | | - protected $skin, $user, $out; |
| 22 | + /** |
| 23 | + * @var Skin |
| 24 | + */ |
| 25 | + protected $skin; |
| 26 | + |
| 27 | + /** |
| 28 | + * @var User |
| 29 | + */ |
| 30 | + protected $user; |
| 31 | + |
| 32 | + /** |
| 33 | + * @var OutputPage |
| 34 | + */ |
| 35 | + protected $out; |
| 36 | + |
23 | 37 | /// Maximum allowed processing time in seconds. |
24 | 38 | protected $processingTime = 30; |
25 | 39 | |
— | — | @@ -139,6 +153,12 @@ |
140 | 154 | $wgOut->addHTML( '</ul>' ); |
141 | 155 | } |
142 | 156 | |
| 157 | + /** |
| 158 | + * @param $group MessageGroup |
| 159 | + * @param $codes |
| 160 | + * @param $from |
| 161 | + * @return string |
| 162 | + */ |
143 | 163 | protected function rebuildButton( $group, $codes, $from ) { |
144 | 164 | $formParams = array( |
145 | 165 | 'method' => 'post', |
— | — | @@ -160,6 +180,8 @@ |
161 | 181 | |
162 | 182 | /** |
163 | 183 | * @todo Very long code block; split up. |
| 184 | + * |
| 185 | + * @param $group MessageGroup |
164 | 186 | */ |
165 | 187 | public function importForm( $group, $code ) { |
166 | 188 | $this->setSubtitle( $group, $code ); |
— | — | @@ -388,6 +410,9 @@ |
389 | 411 | } |
390 | 412 | } |
391 | 413 | |
| 414 | + /** |
| 415 | + * @param $group MessageGroup |
| 416 | + */ |
392 | 417 | public function doModLangs( $group ) { |
393 | 418 | global $wgLang; |
394 | 419 | |
Index: trunk/extensions/Translate/specials/SpecialMyLanguage.php |
— | — | @@ -49,7 +49,7 @@ |
50 | 50 | * Make Special:MyLanguage links red if the target page doesn't exists. |
51 | 51 | * A bit hacky because the core code is not so flexible. |
52 | 52 | * @param $dummy |
53 | | - * @param $target |
| 53 | + * @param $target Title |
54 | 54 | * @param $html |
55 | 55 | * @param $customAttribs |
56 | 56 | * @param $query |
Index: trunk/extensions/Translate/specials/SpecialSupportedLanguages.php |
— | — | @@ -245,7 +245,6 @@ |
246 | 246 | return $users; |
247 | 247 | } |
248 | 248 | |
249 | | - |
250 | 249 | protected function outputLanguageCloud( $names ) { |
251 | 250 | global $wgOut; |
252 | 251 | |
Index: trunk/extensions/Translate/specials/SpecialTranslate.php |
— | — | @@ -16,7 +16,15 @@ |
17 | 17 | * @ingroup SpecialPage TranslateSpecialPage |
18 | 18 | */ |
19 | 19 | class SpecialTranslate extends SpecialPage { |
| 20 | + |
| 21 | + /** |
| 22 | + * @var Task |
| 23 | + */ |
20 | 24 | protected $task = null; |
| 25 | + |
| 26 | + /** |
| 27 | + * @var MessageGroup |
| 28 | + */ |
21 | 29 | protected $group = null; |
22 | 30 | |
23 | 31 | protected $defaults = null; |
— | — | @@ -222,6 +230,12 @@ |
223 | 231 | return $form; |
224 | 232 | } |
225 | 233 | |
| 234 | + /** |
| 235 | + * @param $label |
| 236 | + * @param $option |
| 237 | + * @param $error null |
| 238 | + * @return string |
| 239 | + */ |
226 | 240 | private static function optionRow( $label, $option, $error = null ) { |
227 | 241 | return |
228 | 242 | Xml::openElement( 'tr' ) . |
— | — | @@ -229,7 +243,6 @@ |
230 | 244 | Xml::tags( 'td', null, $option ) . |
231 | 245 | ( $error ? Xml::tags( 'td', array( 'class' => 'mw-sp-translate-error' ), $error ) : '' ) . |
232 | 246 | Xml::closeElement( 'tr' ); |
233 | | - |
234 | 247 | } |
235 | 248 | |
236 | 249 | /* Selectors ahead */ |
Index: trunk/extensions/Translate/specials/SpecialTranslationStats.php |
— | — | @@ -183,9 +183,10 @@ |
184 | 184 | |
185 | 185 | /** |
186 | 186 | * Constructs a table row with label and input in two columns. |
187 | | - * @param $name \string Option name. |
| 187 | + * @param $name string Option name. |
188 | 188 | * @param $opts FormOptions |
189 | | - * @return \string Html. |
| 189 | + * @param $width int |
| 190 | + * @return string Html. |
190 | 191 | */ |
191 | 192 | protected function eInput( $name, FormOptions $opts, $width = 4 ) { |
192 | 193 | $value = $opts[$name]; |
— | — | @@ -301,7 +302,7 @@ |
302 | 303 | |
303 | 304 | /** |
304 | 305 | * Constructs a JavaScript enhanced group selector. |
305 | | - * @return \type{JsSelectToInput} |
| 306 | + * @return JsSelectToInput |
306 | 307 | */ |
307 | 308 | protected function groupSelector() { |
308 | 309 | $groups = MessageGroups::singleton()->getGroups(); |
— | — | @@ -497,6 +498,12 @@ |
498 | 499 | return $cutoff; |
499 | 500 | } |
500 | 501 | |
| 502 | + /** |
| 503 | + * @param $ts |
| 504 | + * @param $amount |
| 505 | + * @param $dir |
| 506 | + * @return int |
| 507 | + */ |
501 | 508 | protected static function roundingAddition( $ts, $amount, $dir ) { |
502 | 509 | if ( $dir === -1 ) { |
503 | 510 | return -1 * ( $ts % $amount ); |
Index: trunk/extensions/Translate/specials/SpecialMessageGroupStats.php |
— | — | @@ -30,7 +30,7 @@ |
31 | 31 | public function getDescription() { |
32 | 32 | return wfMessage( 'translate-mgs-pagename' )->text(); |
33 | 33 | } |
34 | | - |
| 34 | + |
35 | 35 | /// Overwritten from SpecialLanguageStats |
36 | 36 | protected function getAllowedValues() { |
37 | 37 | $groups = MessageGroups::getAllGroups(); |
— | — | @@ -109,7 +109,11 @@ |
110 | 110 | return $out; |
111 | 111 | } |
112 | 112 | |
113 | | - /// Overwriten from SpecialLanguageStats |
| 113 | + /** |
| 114 | + * Overwriten from SpecialLanguageStats |
| 115 | + * |
| 116 | + * @return string |
| 117 | + */ |
114 | 118 | function getTable() { |
115 | 119 | $table = $this->table; |
116 | 120 | $out = ''; |
— | — | @@ -144,6 +148,11 @@ |
145 | 149 | } |
146 | 150 | } |
147 | 151 | |
| 152 | + /** |
| 153 | + * @param $code |
| 154 | + * @param $cache |
| 155 | + * @return string |
| 156 | + */ |
148 | 157 | protected function makeRow( $code, $cache ) { |
149 | 158 | $stats = $cache[$code]; |
150 | 159 | |
— | — | @@ -175,6 +184,11 @@ |
176 | 185 | return $out; |
177 | 186 | } |
178 | 187 | |
| 188 | + /** |
| 189 | + * @param $code |
| 190 | + * @param $params |
| 191 | + * @return string |
| 192 | + */ |
179 | 193 | protected function getMainColumnCell( $code, $params ) { |
180 | 194 | if ( !isset( $this->names ) ) { |
181 | 195 | global $wgLang; |
Index: trunk/extensions/Translate/specials/SpecialLanguageStats.php |
— | — | @@ -21,10 +21,15 @@ |
22 | 22 | * @ingroup SpecialPage TranslateSpecialPage Stats |
23 | 23 | */ |
24 | 24 | class SpecialLanguageStats extends IncludableSpecialPage { |
25 | | - /// @var StatsTable |
| 25 | + |
| 26 | + /** |
| 27 | + * @var StatsTable |
| 28 | + */ |
26 | 29 | protected $table; |
27 | 30 | |
28 | | - /// @var String |
| 31 | + /** |
| 32 | + * @var String |
| 33 | + */ |
29 | 34 | protected $targetValueName = 'code'; |
30 | 35 | |
31 | 36 | /** |
— | — | @@ -68,6 +73,11 @@ |
69 | 74 | */ |
70 | 75 | protected $target; |
71 | 76 | |
| 77 | + /** |
| 78 | + * @var bool |
| 79 | + */ |
| 80 | + protected $purge; |
| 81 | + |
72 | 82 | public function __construct() { |
73 | 83 | parent::__construct( 'LanguageStats' ); |
74 | 84 | global $wgLang; |
— | — | @@ -257,6 +267,12 @@ |
258 | 268 | /// } |
259 | 269 | } |
260 | 270 | |
| 271 | + /** |
| 272 | + * @param $item |
| 273 | + * @param $cache |
| 274 | + * @param $parent string |
| 275 | + * @return string |
| 276 | + */ |
261 | 277 | protected function makeGroupGroup( $item, $cache, $parent = '' ) { |
262 | 278 | if ( !is_array( $item ) ) { |
263 | 279 | return $this->makeGroupRow( $item, $cache, $parent === '' ? false : $parent ); |
— | — | @@ -272,9 +288,15 @@ |
273 | 289 | return $out; |
274 | 290 | } |
275 | 291 | |
| 292 | + /** |
| 293 | + * @param $group |
| 294 | + * @param $cache |
| 295 | + * @param $parent bool |
| 296 | + * @return string |
| 297 | + */ |
276 | 298 | protected function makeGroupRow( $group, $cache, $parent = false ) { |
277 | 299 | if ( $this->table->isBlacklisted( $group->getId(), $this->target ) !== null ) { |
278 | | - return; |
| 300 | + return ''; |
279 | 301 | } |
280 | 302 | |
281 | 303 | $stats = $cache[$group->getId()]; |
Index: trunk/extensions/Translate/specials/SpecialFirstSteps.php |
— | — | @@ -16,8 +16,22 @@ |
17 | 17 | * @ingroup SpecialPage TranslateSpecialPage |
18 | 18 | */ |
19 | 19 | class SpecialFirstSteps extends UnlistedSpecialPage { |
20 | | - protected $skin, $user, $out; |
21 | 20 | |
| 21 | + /** |
| 22 | + * @var Skin |
| 23 | + */ |
| 24 | + protected $skin; |
| 25 | + |
| 26 | + /** |
| 27 | + * @var User |
| 28 | + */ |
| 29 | + protected $user; |
| 30 | + |
| 31 | + /** |
| 32 | + * @var OutputPage |
| 33 | + */ |
| 34 | + protected $out; |
| 35 | + |
22 | 36 | public function __construct() { |
23 | 37 | parent::__construct( 'FirstSteps' ); |
24 | 38 | } |
Index: trunk/extensions/Translate/resources/jquery.form.js |
— | — | @@ -8,7 +8,7 @@ |
9 | 9 | * http://www.opensource.org/licenses/mit-license.php |
10 | 10 | * http://www.gnu.org/licenses/gpl.html |
11 | 11 | */ |
12 | | -;(function($) { |
| 12 | +(function($) { |
13 | 13 | |
14 | 14 | /* |
15 | 15 | Usage Note: |