Index: trunk/extensions/Translate/tag/TranslatablePage.php |
— | — | @@ -57,6 +57,11 @@ |
58 | 58 | * Constructs a translatable page from given text. |
59 | 59 | * Some functions will fail unless you set revision |
60 | 60 | * parameter manually. |
| 61 | + * |
| 62 | + * @param $title Title |
| 63 | + * @param $text string |
| 64 | + * |
| 65 | + * @return TranslatablePage |
61 | 66 | */ |
62 | 67 | public static function newFromText( Title $title, $text ) { |
63 | 68 | $obj = new self( $title ); |
— | — | @@ -314,12 +319,20 @@ |
315 | 320 | |
316 | 321 | /** |
317 | 322 | * Returns a random string that can be used as placeholder. |
| 323 | + * @return string |
318 | 324 | */ |
319 | 325 | protected static function getUniq() { |
320 | 326 | static $i = 0; |
321 | 327 | return "\x7fUNIQ" . dechex( mt_rand( 0, 0x7fffffff ) ) . dechex( mt_rand( 0, 0x7fffffff ) ) . '|' . $i++; |
322 | 328 | } |
323 | 329 | |
| 330 | + /** |
| 331 | + * @param $string string |
| 332 | + * @param $rep |
| 333 | + * @param $start |
| 334 | + * @param $end |
| 335 | + * @return string |
| 336 | + */ |
324 | 337 | protected static function index_replace( $string, $rep, $start, $end ) { |
325 | 338 | return substr( $string, 0, $start ) . $rep . substr( $string, $end ); |
326 | 339 | } |
Index: trunk/extensions/Translate/tag/TPParse.php |
— | — | @@ -223,6 +223,8 @@ |
224 | 224 | /** |
225 | 225 | * Replaces variables from given text. |
226 | 226 | * @todo Is plain str_replace not enough (even the loop is not needed)? |
| 227 | + * |
| 228 | + * @return string |
227 | 229 | */ |
228 | 230 | protected static function replaceVariables( $variables, $text ) { |
229 | 231 | foreach ( $variables as $key => $value ) { |
Index: trunk/extensions/Translate/tag/SpecialPageTranslationMovePage.php |
— | — | @@ -143,30 +143,31 @@ |
144 | 144 | /** |
145 | 145 | * Do the basic checks whether moving is possible and whether |
146 | 146 | * the input looks anywhere near sane. |
| 147 | + * @return bool |
147 | 148 | */ |
148 | 149 | protected function doBasicChecks() { |
149 | 150 | global $wgOut; |
150 | 151 | # Check for database lock |
151 | 152 | if ( wfReadOnly() ) { |
152 | 153 | $wgOut->readOnlyPage(); |
153 | | - return; |
| 154 | + return false; |
154 | 155 | } |
155 | 156 | |
156 | 157 | if ( $this->oldTitle === null ) { |
157 | 158 | $wgOut->showErrorPage( 'notargettitle', 'notargettext' ); |
158 | | - return; |
| 159 | + return false; |
159 | 160 | } |
160 | 161 | |
161 | 162 | if ( !$this->oldTitle->exists() ) { |
162 | 163 | $wgOut->showErrorPage( 'nopagetitle', 'nopagetext' ); |
163 | | - return; |
| 164 | + return false; |
164 | 165 | } |
165 | 166 | |
166 | 167 | # Check rights |
167 | 168 | $permErrors = $this->oldTitle->getUserPermissionsErrors( 'move', $this->user ); |
168 | 169 | if ( !empty( $permErrors ) ) { |
169 | 170 | $wgOut->showPermissionsErrorPage( $permErrors ); |
170 | | - return; |
| 171 | + return false; |
171 | 172 | } |
172 | 173 | |
173 | 174 | // Let the caller know it's safe to continue |
Index: trunk/extensions/Translate/TranslateEditAddons.php |
— | — | @@ -122,6 +122,8 @@ |
123 | 123 | /** |
124 | 124 | * Keep the usual diiba daaba hidden from translators. |
125 | 125 | * Hook: AlternateEdit |
| 126 | + * @param $editpage EditPage |
| 127 | + * @return bool |
126 | 128 | */ |
127 | 129 | public static function intro( $editpage ) { |
128 | 130 | $editpage->suppressIntro = true; |
— | — | @@ -137,6 +139,8 @@ |
138 | 140 | /** |
139 | 141 | * Adds the translation aids and navigation to the normal edit page. |
140 | 142 | * Hook: EditPage::showEditForm:initial |
| 143 | + * @param $object |
| 144 | + * @return bool |
141 | 145 | */ |
142 | 146 | static function addTools( $object ) { |
143 | 147 | $handle = new MessageHandle( $object->mTitle ); |
— | — | @@ -152,6 +156,10 @@ |
153 | 157 | * Replace the normal save button with one that says if you are editing |
154 | 158 | * message documentation to try to avoid accidents. |
155 | 159 | * Hook: EditPageBeforeEditButtons |
| 160 | + * @param $editpage EditPage |
| 161 | + * @param $buttons |
| 162 | + * @param $tabindex |
| 163 | + * @return bool |
156 | 164 | */ |
157 | 165 | static function buttonHack( $editpage, &$buttons, $tabindex ) { |
158 | 166 | global $wgTranslateDocumentationLanguageCode, $wgLang; |
— | — | @@ -293,6 +301,9 @@ |
294 | 302 | /** |
295 | 303 | * Removes protection tab for message namespaces - not useful. |
296 | 304 | * Hook: SkinTemplateTabs |
| 305 | + * @param $skin Skin |
| 306 | + * @param $tabs |
| 307 | + * @return bool |
297 | 308 | */ |
298 | 309 | public static function tabs( $skin, &$tabs ) { |
299 | 310 | $handle = new MessageHandle( $skin->getTitle() ); |
— | — | @@ -357,7 +368,7 @@ |
358 | 369 | if ( $code === $wgTranslateDocumentationLanguageCode ) { |
359 | 370 | return $fuzzy; |
360 | 371 | } |
361 | | - |
| 372 | + |
362 | 373 | // Not all groups have checkers |
363 | 374 | $group = $handle->getGroup(); |
364 | 375 | $checker = $group->getChecker(); |
— | — | @@ -386,7 +397,7 @@ |
387 | 398 | 'rt_type' => RevTag::getType( 'fuzzy' ), |
388 | 399 | 'rt_revision' => $revision |
389 | 400 | ); |
390 | | - |
| 401 | + |
391 | 402 | // Replace the existing fuzzy tag, if any |
392 | 403 | if ( $fuzzy !== false ) { |
393 | 404 | $index = array_keys( $conds ); |
— | — | @@ -402,6 +413,11 @@ |
403 | 414 | * This is used to show diff against current version of source message |
404 | 415 | * when updating a translation. |
405 | 416 | * Hook: Translate:newTranslation |
| 417 | + * @param $handle MessageHandle |
| 418 | + * @param $revision Revision |
| 419 | + * @param $text string |
| 420 | + * @param $user User |
| 421 | + * @return bool |
406 | 422 | */ |
407 | 423 | public static function updateTransverTag( MessageHandle $handle, $revision, $text, User $user ) { |
408 | 424 | $group = $handle->getGroup(); |
Index: trunk/extensions/Translate/TranslateHooks.php |
— | — | @@ -143,6 +143,10 @@ |
144 | 144 | /** |
145 | 145 | * Hook: ParserFirstCallInit |
146 | 146 | * Registers \<languages> tag with the parser. |
| 147 | + * |
| 148 | + * @param $parser Parser |
| 149 | + * |
| 150 | + * @return bool |
147 | 151 | */ |
148 | 152 | public static function setupParserHooks( $parser ) { |
149 | 153 | // For nice language list in-page |
— | — | @@ -182,6 +186,9 @@ |
183 | 187 | /** |
184 | 188 | * Set the right page content language for message group translations ("Page/xx"). |
185 | 189 | * Hook: PageContentLanguage |
| 190 | + * @param $title Title |
| 191 | + * @param $pageLang |
| 192 | + * @return bool |
186 | 193 | */ |
187 | 194 | public static function onPageContentLanguage( $title, &$pageLang ) { |
188 | 195 | global $wgTranslateMessageNamespaces; |
Index: trunk/extensions/Translate/utils/JsSelectToInput.php |
— | — | @@ -93,6 +93,7 @@ |
94 | 94 | * @param $msg \string Message key. |
95 | 95 | * @param $source \string Html id. |
96 | 96 | * @param $target \string Html id. |
| 97 | + * @return string |
97 | 98 | */ |
98 | 99 | protected function getButton( $msg, $source, $target ) { |
99 | 100 | $source = Xml::escapeJsString( $source ); |
Index: trunk/extensions/Translate/utils/UserToggles.php |
— | — | @@ -87,6 +87,7 @@ |
88 | 88 | |
89 | 89 | /** |
90 | 90 | * JavsScript selector for language codes. |
| 91 | + * @return \JsSelectToInput |
91 | 92 | */ |
92 | 93 | protected static function languageSelector() { |
93 | 94 | global $wgLang; |
Index: trunk/extensions/Translate/utils/Html.php |
— | — | @@ -140,6 +140,8 @@ |
141 | 141 | |
142 | 142 | /** |
143 | 143 | * Shortcut for param( name = id ). Chain-accessor. |
| 144 | + * @param $value |
| 145 | + * @return mixed |
144 | 146 | */ |
145 | 147 | public function id( $value = null ) { |
146 | 148 | return $this->param( 'id', $value ); |
Index: trunk/extensions/Translate/utils/StatsTable.php |
— | — | @@ -223,7 +223,7 @@ |
224 | 224 | */ |
225 | 225 | public function getGroupDescription( MessageGroup $group ) { |
226 | 226 | $code = $this->lang->getCode(); |
227 | | - |
| 227 | + |
228 | 228 | $cache = wfGetCache( CACHE_ANYTHING ); |
229 | 229 | $key = wfMemckey( "translate-groupdesc-$code-" . $group->getId() ); |
230 | 230 | $desc = $cache->get( $key ); |
— | — | @@ -275,6 +275,8 @@ |
276 | 276 | /** |
277 | 277 | * Used to circumvent ugly tooltips when newlines are used in the |
278 | 278 | * message content ("x\ny" becomes "x y"). |
| 279 | + * @param $text |
| 280 | + * @return string |
279 | 281 | */ |
280 | 282 | public static function formatTooltip( $text ) { |
281 | 283 | $wordSeparator = wfMessage( 'word-separator' )->text(); |
Index: trunk/extensions/Translate/utils/MessageGroupStats.php |
— | — | @@ -154,6 +154,7 @@ |
155 | 155 | |
156 | 156 | /** |
157 | 157 | * Returns an array of needed database fields. |
| 158 | + * @return array |
158 | 159 | */ |
159 | 160 | protected static function extractNumbers( $row ) { |
160 | 161 | return array( |
— | — | @@ -317,7 +318,7 @@ |
318 | 319 | /** |
319 | 320 | * Converts input to "+2" "-4" type of string. |
320 | 321 | * @param $number int |
321 | | - * @returns string |
| 322 | + * @return string |
322 | 323 | */ |
323 | 324 | protected static function stringifyNumber( $number ) { |
324 | 325 | $number = intval( $number ); |
Index: trunk/extensions/Translate/utils/TranslationHelpers.php |
— | — | @@ -1147,6 +1147,8 @@ |
1148 | 1148 | |
1149 | 1149 | /** |
1150 | 1150 | * Checks whether the given service has exceeded failure count |
| 1151 | + * @param $service string |
| 1152 | + * @return bool |
1151 | 1153 | */ |
1152 | 1154 | public static function checkTranslationServiceFailure( $service ) { |
1153 | 1155 | global $wgMemc; |
Index: trunk/extensions/Translate/utils/MessageGroupCache.php |
— | — | @@ -14,7 +14,7 @@ |
15 | 15 | * of the actual format. |
16 | 16 | */ |
17 | 17 | class MessageGroupCache { |
18 | | - /// \string |
| 18 | + /// \string |
19 | 19 | protected $group; |
20 | 20 | /// CdbReader |
21 | 21 | protected $cache; |
— | — | @@ -210,6 +210,7 @@ |
211 | 211 | |
212 | 212 | /** |
213 | 213 | * Returns full path the the cache file. |
| 214 | + * @return string |
214 | 215 | */ |
215 | 216 | protected function getCacheFileName() { |
216 | 217 | return TranslateUtils::cacheFile( "translate_groupcache-{$this->group->getId()}-{$this->code}.cdb" ); |
Index: trunk/extensions/Translate/utils/RevTag.php |
— | — | @@ -74,7 +74,7 @@ |
75 | 75 | |
76 | 76 | /** |
77 | 77 | * Loads the list of tags from database using the old schema |
78 | | - * return array tag names => tag id |
| 78 | + * @return array tag names => tag id |
79 | 79 | */ |
80 | 80 | protected static function loadTags() { |
81 | 81 | static $tags = null; |
Index: trunk/extensions/Translate/TranslateUtils.php |
— | — | @@ -132,7 +132,7 @@ |
133 | 133 | "ORDER BY lang ASC, rc_timestamp DESC"; |
134 | 134 | |
135 | 135 | $res = $dbr->query( $sql, __METHOD__ ); |
136 | | - $rows = iterator_to_array( $res ); |
| 136 | + $rows = iterator_to_array( $res ); |
137 | 137 | return $rows; |
138 | 138 | } |
139 | 139 | |
— | — | @@ -195,6 +195,7 @@ |
196 | 196 | * @param $language \string Language code of the language the names should |
197 | 197 | * be localised to. |
198 | 198 | * @param $selectedId \string The language code that is selected by default. |
| 199 | + * @return string |
199 | 200 | */ |
200 | 201 | public static function languageSelector( $language, $selectedId ) { |
201 | 202 | if ( is_callable( array( 'LanguageNames', 'getNames' ) ) ) { |