Index: trunk/extensions/Translate/MessageCollection.php |
— | — | @@ -61,9 +61,9 @@ |
62 | 62 | |
63 | 63 | /** |
64 | 64 | * Construct a new message collection from definitions. |
65 | | - * @param $definitions \type{MessageDefinitions} |
66 | | - * @param $code \string Language code. |
67 | | - * @return \type{MessageCollection} |
| 65 | + * @param $definitions MessageDefinitions |
| 66 | + * @param $code string Language code. |
| 67 | + * @return MessageCollection |
68 | 68 | */ |
69 | 69 | public static function newFromDefinitions( MessageDefinitions $definitions, $code ) { |
70 | 70 | $collection = new self( $code ); |
Index: trunk/extensions/Translate/scripts/magic-export.php |
— | — | @@ -59,6 +59,7 @@ |
60 | 60 | $this->output( "Opening file handles and loading current data...\n" ); |
61 | 61 | |
62 | 62 | $groups = MessageGroups::singleton()->getGroups(); |
| 63 | + $filename = null; |
63 | 64 | foreach ( $groups as $group ) { |
64 | 65 | if ( !$group instanceof ExtensionMessageGroup ) { |
65 | 66 | continue; |
Index: trunk/extensions/Translate/scripts/sync-group.php |
— | — | @@ -247,6 +247,7 @@ |
248 | 248 | $wikiDate = 'Unknown'; |
249 | 249 | } |
250 | 250 | |
| 251 | + // TODO: $startDate is unused |
251 | 252 | if ( $startTs ) { |
252 | 253 | $startTs = wfTimestamp( TS_UNIX, $startTs ); |
253 | 254 | $startDate = $wgLang->sprintfDate( $iso, wfTimestamp( TS_MW, $startTs ) ); |
— | — | @@ -254,6 +255,7 @@ |
255 | 256 | $startDate = 'Unknown'; |
256 | 257 | } |
257 | 258 | |
| 259 | + // TODO: $endDate is unused |
258 | 260 | if ( $endTs ) { |
259 | 261 | $endTs = wfTimestamp( TS_UNIX, $endTs ); |
260 | 262 | $endDate = $wgLang->sprintfDate( $iso, wfTimestamp( TS_MW, $endTs ) ); |
— | — | @@ -383,7 +385,7 @@ |
384 | 386 | |
385 | 387 | /** |
386 | 388 | * Does the actual edit. |
387 | | - * @param $title \type{Title} |
| 389 | + * @param $title \Title |
388 | 390 | * @param $translation \string |
389 | 391 | * @param $comment \string Edit summary. |
390 | 392 | */ |
Index: trunk/extensions/Translate/MessageGroups.php |
— | — | @@ -199,7 +199,7 @@ |
200 | 200 | * @param $code \string Language code for this collection. |
201 | 201 | * @param $unique \bool Whether to build collection for messages unique to this |
202 | 202 | * group only. |
203 | | - * @return \type |
| 203 | + * @return MessageCollection |
204 | 204 | */ |
205 | 205 | public function initCollection( $code, $unique = false ) { |
206 | 206 | if ( !$unique ) { |
— | — | @@ -253,6 +253,10 @@ |
254 | 254 | return isset( $tags[$type] ) ? $tags[$type] : array(); |
255 | 255 | } |
256 | 256 | |
| 257 | + /** |
| 258 | + * @param $code string |
| 259 | + * @return bool |
| 260 | + */ |
257 | 261 | protected function isSourceLanguage( $code ) { |
258 | 262 | return $code === $this->getSourceLanguage(); |
259 | 263 | } |
— | — | @@ -1000,6 +1004,10 @@ |
1001 | 1005 | } |
1002 | 1006 | } |
1003 | 1007 | |
| 1008 | + /** |
| 1009 | + * @param $id |
| 1010 | + * @return bool |
| 1011 | + */ |
1004 | 1012 | public static function exists( $id ) { |
1005 | 1013 | return (bool) self::getGroup( $id ); |
1006 | 1014 | } |
— | — | @@ -1018,7 +1026,10 @@ |
1019 | 1027 | self::init(); |
1020 | 1028 | } |
1021 | 1029 | |
1022 | | - /// Constructor function. |
| 1030 | + /** |
| 1031 | + * Constructor function. |
| 1032 | + * @return MessageGroups |
| 1033 | + */ |
1023 | 1034 | public static function singleton() { |
1024 | 1035 | static $instance; |
1025 | 1036 | if ( !$instance instanceof self ) { |
Index: trunk/extensions/Translate/tag/DeleteJob.php |
— | — | @@ -133,7 +133,7 @@ |
134 | 134 | |
135 | 135 | /** |
136 | 136 | * Get a user object for doing edits. |
137 | | - * @return \User |
| 137 | + * @return User |
138 | 138 | */ |
139 | 139 | public function getUser() { |
140 | 140 | return User::newFromName( $this->params['user'], false ); |
Index: trunk/extensions/Translate/tag/MoveJob.php |
— | — | @@ -140,7 +140,7 @@ |
141 | 141 | |
142 | 142 | /** |
143 | 143 | * Get a user object for doing edits. |
144 | | - * @return \User |
| 144 | + * @return User |
145 | 145 | */ |
146 | 146 | public function getUser() { |
147 | 147 | return User::newFromName( $this->params['user'], false ); |
Index: trunk/extensions/Translate/TranslateHooks.php |
— | — | @@ -161,7 +161,11 @@ |
162 | 162 | return true; |
163 | 163 | } |
164 | 164 | |
165 | | - /// Hook: LoadExtensionSchemaUpdates |
| 165 | + /** |
| 166 | + * Hook: LoadExtensionSchemaUpdates |
| 167 | + * @param $updater DatabaseUpdater |
| 168 | + * @return bool |
| 169 | + */ |
166 | 170 | public static function schemaUpdates( $updater ) { |
167 | 171 | $dir = dirname( __FILE__ ) . '/sql'; |
168 | 172 | |
Index: trunk/extensions/Translate/_autoload.php |
— | — | @@ -37,6 +37,7 @@ |
38 | 38 | |
39 | 39 | $wgAutoloadClasses['MessageCollection'] = $dir . 'MessageCollection.php'; |
40 | 40 | $wgAutoloadClasses['MessageDefinitions'] = $dir . 'MessageCollection.php'; |
| 41 | + |
41 | 42 | $wgAutoloadClasses['TMessage'] = $dir . 'Message.php'; |
42 | 43 | $wgAutoloadClasses['ThinMessage'] = $dir . 'Message.php'; |
43 | 44 | $wgAutoloadClasses['FatMessage'] = $dir . 'Message.php'; |
Index: trunk/extensions/Translate/utils/MessageIndex.php |
— | — | @@ -23,6 +23,9 @@ |
24 | 24 | /// @var array |
25 | 25 | protected $index; |
26 | 26 | |
| 27 | + /** |
| 28 | + * @return MessageIndex |
| 29 | + */ |
27 | 30 | public static function singleton() { |
28 | 31 | if ( self::$instance === null ) { |
29 | 32 | global $wgTranslateMessageIndex; |
Index: trunk/extensions/Translate/utils/MessageIndexRebuildJob.php |
— | — | @@ -14,6 +14,10 @@ |
15 | 15 | * @ingroup JobQueue |
16 | 16 | */ |
17 | 17 | class MessageIndexRebuildJob extends Job { |
| 18 | + |
| 19 | + /** |
| 20 | + * @return MessageIndexRebuildJob |
| 21 | + */ |
18 | 22 | public static function newJob() { |
19 | 23 | $job = new self( Title::newMainPage() ); |
20 | 24 | return $job; |
Index: trunk/extensions/Translate/utils/TranslationHelpers.php |
— | — | @@ -964,15 +964,26 @@ |
965 | 965 | return $diff->getDiff( wfMsgHtml( 'tpt-diff-old' ), wfMsgHtml( 'tpt-diff-new' ) ); |
966 | 966 | } |
967 | 967 | |
| 968 | + /** |
| 969 | + * @param $label string |
| 970 | + * @return string |
| 971 | + */ |
968 | 972 | protected static function legend( $label ) { |
969 | 973 | # Float it to the opposite direction |
970 | 974 | return Html::rawElement( 'div', array( 'class' => 'mw-translate-legend' ), $label ); |
971 | 975 | } |
972 | 976 | |
| 977 | + /** |
| 978 | + * @return string |
| 979 | + */ |
973 | 980 | protected static function clear() { |
974 | 981 | return Html::element( 'div', array( 'style' => 'clear:both;' ) ); |
975 | 982 | } |
976 | 983 | |
| 984 | + /** |
| 985 | + * @param $code string |
| 986 | + * @return array |
| 987 | + */ |
977 | 988 | protected static function getFallbacks( $code ) { |
978 | 989 | global $wgUser, $wgTranslateLanguageFallbacks; |
979 | 990 | |
— | — | @@ -1010,6 +1021,13 @@ |
1011 | 1022 | return array_unique( $fallbacks ); |
1012 | 1023 | } |
1013 | 1024 | |
| 1025 | + /** |
| 1026 | + * @param $msg string |
| 1027 | + * @param $code string |
| 1028 | + * @param $title Title |
| 1029 | + * @param $makelink |
| 1030 | + * @return string |
| 1031 | + */ |
1014 | 1032 | protected function doBox( $msg, $code, $title = false, $makelink = false ) { |
1015 | 1033 | global $wgUser, $wgLang; |
1016 | 1034 | |
— | — | @@ -1050,6 +1068,9 @@ |
1051 | 1069 | return TranslateUtils::fieldset( $title, Html::element( 'span', null, $msg ), $attributes ); |
1052 | 1070 | } |
1053 | 1071 | |
| 1072 | + /** |
| 1073 | + * @return null|string |
| 1074 | + */ |
1054 | 1075 | public function getLazySuggestionBox() { |
1055 | 1076 | if ( $this->group === null || !$this->targetLanguage ) { |
1056 | 1077 | return null; |
— | — | @@ -1070,11 +1091,19 @@ |
1071 | 1092 | return Html::rawElement( 'div', array( 'id' => $id ), $script . $spinner ); |
1072 | 1093 | } |
1073 | 1094 | |
| 1095 | + /** |
| 1096 | + * @return string |
| 1097 | + */ |
1074 | 1098 | public function dialogID() { |
1075 | 1099 | $hash = sha1( $this->title->getPrefixedDbKey() ); |
1076 | 1100 | return substr( $hash, 0, 4 ); |
1077 | 1101 | } |
1078 | 1102 | |
| 1103 | + /** |
| 1104 | + * @param $source |
| 1105 | + * @param $lang |
| 1106 | + * @return string |
| 1107 | + */ |
1079 | 1108 | public function adder( $source, $lang = null ) { |
1080 | 1109 | if ( !$this->editMode ) { |
1081 | 1110 | return ''; |
— | — | @@ -1092,10 +1121,19 @@ |
1093 | 1122 | return Html::element( 'a', $params, '↓' ); |
1094 | 1123 | } |
1095 | 1124 | |
| 1125 | + /** |
| 1126 | + * @param $id string|int |
| 1127 | + * @param $text string |
| 1128 | + * @return string |
| 1129 | + */ |
1096 | 1130 | public function wrapInsert( $id, $text ) { |
1097 | 1131 | return Html::element( 'pre', array( 'id' => $id, 'style' => 'display: none;' ), $text ); |
1098 | 1132 | } |
1099 | 1133 | |
| 1134 | + /** |
| 1135 | + * @param $text string |
| 1136 | + * @return string |
| 1137 | + */ |
1100 | 1138 | public function suggestionField( $text ) { |
1101 | 1139 | static $counter = 0; |
1102 | 1140 | |
— | — | @@ -1131,6 +1169,10 @@ |
1132 | 1170 | return $wgUser->getSkin()->link( $target, $text, $jsEdit, $params ); |
1133 | 1171 | } |
1134 | 1172 | |
| 1173 | + /** |
| 1174 | + * @param $id string |
| 1175 | + * @return string |
| 1176 | + */ |
1135 | 1177 | public static function jQueryPathId( $id ) { |
1136 | 1178 | return Xml::encodeJsVar( "#$id" ); |
1137 | 1179 | } |