Index: trunk/extensions/Translate/MessageCollection.php |
— | — | @@ -591,6 +591,7 @@ |
592 | 592 | |
593 | 593 | /** |
594 | 594 | * ArrayAccess methods. @{ |
| 595 | + * @return bool |
595 | 596 | */ |
596 | 597 | public function offsetExists( $offset ) { |
597 | 598 | return isset( $this->keys[$offset] ); |
Index: trunk/extensions/Translate/scripts/magic-export.php |
— | — | @@ -274,6 +274,8 @@ |
275 | 275 | |
276 | 276 | /** |
277 | 277 | * Copied from cli.inc. |
| 278 | + * @param $codes |
| 279 | + * @return array |
278 | 280 | */ |
279 | 281 | private static function parseLanguageCodes( /* string */ $codes ) { |
280 | 282 | $langs = array_map( 'trim', explode( ',', $codes ) ); |
Index: trunk/extensions/Translate/scripts/poimport.php |
— | — | @@ -91,6 +91,7 @@ |
92 | 92 | |
93 | 93 | /** |
94 | 94 | * Parses relevant stuff from the po file. |
| 95 | + * @return array|bool |
95 | 96 | */ |
96 | 97 | public function parse() { |
97 | 98 | $data = file_get_contents( $this->file ); |
Index: trunk/extensions/Translate/MessageGroups.php |
— | — | @@ -45,6 +45,7 @@ |
46 | 46 | |
47 | 47 | /** |
48 | 48 | * Returns a list of optional and ignored messages in 2-d array. |
| 49 | + * @return array |
49 | 50 | */ |
50 | 51 | public function getBools() { |
51 | 52 | return array( |
— | — | @@ -129,6 +130,7 @@ |
130 | 131 | * This function can be used for meta message groups to list their "own" |
131 | 132 | * messages. For example branched message groups can exclude the messages they |
132 | 133 | * share with each other. |
| 134 | + * @return array |
133 | 135 | */ |
134 | 136 | public function getUniqueDefinitions() { |
135 | 137 | return $this->meta ? array() : $this->getDefinitions(); |
— | — | @@ -197,6 +199,7 @@ |
198 | 200 | * @param $code \string Language code for this collection. |
199 | 201 | * @param $unique \bool Whether to build collection for messages unique to this |
200 | 202 | * group only. |
| 203 | + * @return \type |
201 | 204 | */ |
202 | 205 | public function initCollection( $code, $unique = false ) { |
203 | 206 | if ( !$unique ) { |
— | — | @@ -225,6 +228,7 @@ |
226 | 229 | |
227 | 230 | /** |
228 | 231 | * Can be overwritten to retun false if something is wrong. |
| 232 | + * @return bool |
229 | 233 | */ |
230 | 234 | public function exists() { |
231 | 235 | return true; |
— | — | @@ -875,6 +879,7 @@ |
876 | 880 | |
877 | 881 | /** |
878 | 882 | * Returns a cacher object. |
| 883 | + * @return BagOStuff |
879 | 884 | */ |
880 | 885 | protected static function getCache() { |
881 | 886 | return wfGetCache( CACHE_ANYTHING ); |
— | — | @@ -1042,6 +1047,7 @@ |
1043 | 1048 | /** |
1044 | 1049 | * Returns group strucuted into sub groups. First group in each subgroup is |
1045 | 1050 | * considered as the main group. |
| 1051 | + * @return array |
1046 | 1052 | */ |
1047 | 1053 | public static function getGroupStructure() { |
1048 | 1054 | global $wgTranslateGroupStructure; |
Index: trunk/extensions/Translate/tag/SpecialPageTranslation.php |
— | — | @@ -452,6 +452,9 @@ |
453 | 453 | * - Updates revtags table |
454 | 454 | * - Setups renderjobs to update the translation pages |
455 | 455 | * - Invalidates caches |
| 456 | + * @param $page TranslatablePage |
| 457 | + * @param $sections array |
| 458 | + * @return array|bool |
456 | 459 | */ |
457 | 460 | public function markForTranslation( TranslatablePage $page, Array $sections ) { |
458 | 461 | global $wgRequest; |
Index: trunk/extensions/Translate/tag/SpecialPageTranslationDeletePage.php |
— | — | @@ -16,8 +16,13 @@ |
17 | 17 | */ |
18 | 18 | class SpecialPageTranslationDeletePage extends UnlistedSpecialPage { |
19 | 19 | // Basic form parameters both as text and as titles |
20 | | - protected $text, $title; |
| 20 | + protected $text; |
21 | 21 | |
| 22 | + /** |
| 23 | + * @var Title |
| 24 | + */ |
| 25 | + protected $title; |
| 26 | + |
22 | 27 | // Other form parameters |
23 | 28 | /// 'check' or 'perform' |
24 | 29 | protected $subaction; |
— | — | @@ -34,7 +39,11 @@ |
35 | 40 | /// Contains the language code if we are working with translation page |
36 | 41 | protected $code; |
37 | 42 | |
38 | | - /// User instance. |
| 43 | + /** |
| 44 | + * User instance. |
| 45 | + * |
| 46 | + * @var User |
| 47 | + */ |
39 | 48 | protected $user; |
40 | 49 | |
41 | 50 | public function __construct() { |
— | — | @@ -107,30 +116,31 @@ |
108 | 117 | /** |
109 | 118 | * Do the basic checks whether moving is possible and whether |
110 | 119 | * the input looks anywhere near sane. |
| 120 | + * @return bool |
111 | 121 | */ |
112 | 122 | protected function doBasicChecks() { |
113 | 123 | global $wgOut; |
114 | 124 | # Check for database lock |
115 | 125 | if ( wfReadOnly() ) { |
116 | 126 | $wgOut->readOnlyPage(); |
117 | | - return; |
| 127 | + return false; |
118 | 128 | } |
119 | 129 | |
120 | 130 | if ( $this->title === null ) { |
121 | 131 | $wgOut->showErrorPage( 'notargettitle', 'notargettext' ); |
122 | | - return; |
| 132 | + return false; |
123 | 133 | } |
124 | 134 | |
125 | 135 | if ( !$this->title->exists() ) { |
126 | 136 | $wgOut->showErrorPage( 'nopagetitle', 'nopagetext' ); |
127 | | - return; |
| 137 | + return false; |
128 | 138 | } |
129 | 139 | |
130 | 140 | # Check rights |
131 | 141 | $permErrors = $this->title->getUserPermissionsErrors( 'delete', $this->user ); |
132 | 142 | if ( !empty( $permErrors ) ) { |
133 | 143 | $wgOut->showPermissionsErrorPage( $permErrors ); |
134 | | - return; |
| 144 | + return false; |
135 | 145 | } |
136 | 146 | |
137 | 147 | // Let the caller know it's safe to continue |
— | — | @@ -140,6 +150,7 @@ |
141 | 151 | /** |
142 | 152 | * Checks token. Use before real actions happen. Have to use wpEditToken |
143 | 153 | * for compatibility for SpecialMovepage.php. |
| 154 | + * @return bool |
144 | 155 | */ |
145 | 156 | protected function checkToken() { |
146 | 157 | global $wgRequest; |
Index: trunk/extensions/Translate/tag/DeleteJob.php |
— | — | @@ -133,6 +133,7 @@ |
134 | 134 | |
135 | 135 | /** |
136 | 136 | * Get a user object for doing edits. |
| 137 | + * @return \User |
137 | 138 | */ |
138 | 139 | public function getUser() { |
139 | 140 | return User::newFromName( $this->params['user'], false ); |
Index: trunk/extensions/Translate/tag/PageTranslationHooks.php |
— | — | @@ -61,6 +61,9 @@ |
62 | 62 | /** |
63 | 63 | * Set the right page content language for translated pages ("Page/xx"). |
64 | 64 | * Hook: PageContentLanguage |
| 65 | + * @param $title Title |
| 66 | + * @param $pageLang |
| 67 | + * @return bool |
65 | 68 | */ |
66 | 69 | public static function onPageContentLanguage( $title, &$pageLang ) { |
67 | 70 | // For translation pages, parse plural, grammar etc with correct language, and set the right direction |
— | — | @@ -71,13 +74,23 @@ |
72 | 75 | return true; |
73 | 76 | } |
74 | 77 | |
75 | | - // Only called from hook |
| 78 | + /** |
| 79 | + * Only called from hook |
| 80 | + * |
| 81 | + * @param $outputpage |
| 82 | + * @param $text |
| 83 | + * @return bool |
| 84 | + */ |
76 | 85 | public static function injectCss( $outputpage, $text ) { |
77 | 86 | $outputpage->addModules( 'ext.translate' ); |
78 | 87 | |
79 | 88 | return true; |
80 | 89 | } |
81 | 90 | |
| 91 | + /** |
| 92 | + * @param Title $title |
| 93 | + * @return types |
| 94 | + */ |
82 | 95 | public static function titleToGroup( Title $title ) { |
83 | 96 | $namespace = $title->getNamespace(); |
84 | 97 | $text = $title->getDBkey(); |
— | — | @@ -298,6 +311,16 @@ |
299 | 312 | /** |
300 | 313 | * When attempting to save, last resort. Edit page would only display |
301 | 314 | * edit conflict if there wasn't tpSyntaxCheckForEditPage |
| 315 | + * @param $article Article |
| 316 | + * @param $user User |
| 317 | + * @param $text |
| 318 | + * @param $summary string |
| 319 | + * @param $minor bool |
| 320 | + * @param $_ |
| 321 | + * @param $_ |
| 322 | + * @param $flags |
| 323 | + * @param $status |
| 324 | + * @return bool |
302 | 325 | */ |
303 | 326 | public static function tpSyntaxCheck( $article, $user, $text, $summary, |
304 | 327 | $minor, $_, $_, $flags, $status ) { |
Index: trunk/extensions/Translate/tag/MoveJob.php |
— | — | @@ -140,6 +140,7 @@ |
141 | 141 | |
142 | 142 | /** |
143 | 143 | * Get a user object for doing edits. |
| 144 | + * @return \User |
144 | 145 | */ |
145 | 146 | public function getUser() { |
146 | 147 | return User::newFromName( $this->params['user'], false ); |
Index: trunk/extensions/Translate/specials/SpecialMyLanguage.php |
— | — | @@ -48,6 +48,14 @@ |
49 | 49 | /** |
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 | + * @param $dummy |
| 53 | + * @param $target |
| 54 | + * @param $html |
| 55 | + * @param $customAttribs |
| 56 | + * @param $query |
| 57 | + * @param $options |
| 58 | + * @param $ret |
| 59 | + * @return bool |
52 | 60 | */ |
53 | 61 | public static function linkfix( $dummy, $target, &$html, &$customAttribs, &$query, &$options, &$ret ) { |
54 | 62 | if ( $target->getNamespace() == NS_SPECIAL ) { |
Index: trunk/extensions/Translate/specials/SpecialImportTranslations.php |
— | — | @@ -99,6 +99,8 @@ |
100 | 100 | * Checks for error state from the return value of loadFile and parseFile |
101 | 101 | * functions. Prints the error and the form and returns true if there is an |
102 | 102 | * error. Returns false and does nothing if there is no error. |
| 103 | + * @param $msg array |
| 104 | + * @return bool |
103 | 105 | */ |
104 | 106 | protected function checkError( $msg ) { |
105 | 107 | if ( $msg[0] !== 'ok' ) { |
— | — | @@ -179,6 +181,8 @@ |
180 | 182 | |
181 | 183 | /** |
182 | 184 | * Try to get the file data from any of the supported methods. |
| 185 | + * @param $filedata |
| 186 | + * @return array |
183 | 187 | */ |
184 | 188 | protected function loadFile( &$filedata ) { |
185 | 189 | $source = $this->request->getText( 'upload-type' ); |
— | — | @@ -226,6 +230,8 @@ |
227 | 231 | |
228 | 232 | /** |
229 | 233 | * Try parsing file. |
| 234 | + * @param $data |
| 235 | + * @return array |
230 | 236 | */ |
231 | 237 | protected function parseFile( $data ) { |
232 | 238 | /** Construct a dummy group for us... |
Index: trunk/extensions/Translate/specials/SpecialTranslationStats.php |
— | — | @@ -467,6 +467,7 @@ |
468 | 468 | * @param $scale string One of hours, days, weeks, months |
469 | 469 | * @param $cutoff int Timestamp in unix format. |
470 | 470 | * @param $direction string One of earlier, later |
| 471 | + * @return int |
471 | 472 | */ |
472 | 473 | protected static function roundTimestampToCutoff( $scale, $cutoff, $direction = 'earlier' ) { |
473 | 474 | $dir = $direction === 'earlier' ? -1 : 1; |
Index: trunk/extensions/Translate/specials/SpecialMagic.php |
— | — | @@ -52,6 +52,7 @@ |
53 | 53 | /** |
54 | 54 | * Returns HTML5 output of the form |
55 | 55 | * GLOBALS: $wgLang, $wgScript |
| 56 | + * @return string |
56 | 57 | */ |
57 | 58 | protected function getForm() { |
58 | 59 | global $wgLang, $wgScript; |
Index: trunk/extensions/Translate/ffs/MediaWikiComplexMessages.php |
— | — | @@ -200,6 +200,9 @@ |
201 | 201 | } |
202 | 202 | |
203 | 203 | /** |
| 204 | + * @param $group |
| 205 | + * @param $code |
| 206 | + * @return array |
204 | 207 | */ |
205 | 208 | protected function readVariable( $group, $code ) { |
206 | 209 | $file = $group['file']; |
— | — | @@ -503,6 +506,8 @@ |
504 | 507 | |
505 | 508 | /** |
506 | 509 | * Returns string with quotes that should be valid php |
| 510 | + * @param $data string |
| 511 | + * @return string |
507 | 512 | */ |
508 | 513 | protected function normalize( $data ) { |
509 | 514 | # Escape quotes |
Index: trunk/extensions/Translate/ffs/Gettext.php |
— | — | @@ -242,6 +242,8 @@ |
243 | 243 | /** |
244 | 244 | * Generates unique key for each message. Changing this WILL BREAK ALL |
245 | 245 | * existing pages! |
| 246 | + * @param $item |
| 247 | + * @return string |
246 | 248 | */ |
247 | 249 | public static function generateKeyFromItem( $item ) { |
248 | 250 | $lang = Language::factory( 'en' ); |
— | — | @@ -264,6 +266,9 @@ |
265 | 267 | * not allowed in MediaWiki pages, the default action is to append |
266 | 268 | * \-character at the end of the message. You can also choose to ignore it |
267 | 269 | * and use the trim action instead. |
| 270 | + * @param $data |
| 271 | + * @param $whitespace string |
| 272 | + * @return string |
268 | 273 | */ |
269 | 274 | public static function formatForWiki( $data, $whitespace = 'mark' ) { |
270 | 275 | $quotePattern = '/(^"|"$\n?)/m'; |