| Index: trunk/extensions/CentralNotice/CentralNotice.php |
| — | — | @@ -102,6 +102,8 @@ |
| 103 | 103 | |
| 104 | 104 | /** |
| 105 | 105 | * UnitTestsList hook handler |
| | 106 | + * @param $files array |
| | 107 | + * @return bool |
| 106 | 108 | */ |
| 107 | 109 | function efCentralNoticeUnitTests( &$files ) { |
| 108 | 110 | $files[] = dirname( __FILE__ ) . '/tests/CentralNoticeTest.php'; |
| — | — | @@ -165,6 +167,8 @@ |
| 166 | 168 | |
| 167 | 169 | /** |
| 168 | 170 | * LoadExtensionSchemaUpdates hook handler |
| | 171 | + * @param $updater DatabaseUpdater|null |
| | 172 | + * @return bool |
| 169 | 173 | */ |
| 170 | 174 | function efCentralNoticeSchema( $updater = null ) { |
| 171 | 175 | $base = dirname( __FILE__ ); |
| — | — | @@ -222,21 +226,25 @@ |
| 223 | 227 | |
| 224 | 228 | /** |
| 225 | 229 | * BeforePageDisplay hook handler |
| | 230 | + * @param $out OutputPage |
| | 231 | + * @param $skin Skin |
| | 232 | + * @return bool |
| 226 | 233 | */ |
| 227 | 234 | function efCentralNoticeLoader( $out, $skin ) { |
| 228 | | - global $wgOut; |
| 229 | | - |
| 230 | 235 | // Include '.js' to exempt script from squid cache expiration override |
| 231 | 236 | $centralLoader = SpecialPage::getTitleFor( 'BannerController' )->getLocalUrl( 'cache=/cn.js' ); |
| 232 | 237 | |
| 233 | 238 | // Insert the banner controller Javascript into the page |
| 234 | | - $wgOut->addScriptFile( $centralLoader ); |
| | 239 | + $out->addScriptFile( $centralLoader ); |
| 235 | 240 | |
| 236 | 241 | return true; |
| 237 | 242 | } |
| 238 | 243 | |
| 239 | 244 | /** |
| 240 | 245 | * SkinAfterBottomScripts hook handler |
| | 246 | + * @param $skin Skin |
| | 247 | + * @param $text string |
| | 248 | + * @return bool |
| 241 | 249 | */ |
| 242 | 250 | function efCentralNoticeGeoLoader( $skin, &$text ) { |
| 243 | 251 | // Insert the geo IP lookup |
| — | — | @@ -244,9 +252,10 @@ |
| 245 | 253 | return true; |
| 246 | 254 | } |
| 247 | 255 | |
| 248 | | - |
| 249 | 256 | /** |
| 250 | 257 | * MakeGlobalVariablesScript hook handler |
| | 258 | + * @param $vars array |
| | 259 | + * @return bool |
| 251 | 260 | */ |
| 252 | 261 | function efCentralNoticeDefaults( &$vars ) { |
| 253 | 262 | // Using global $wgUser for compatibility with 1.18 |
| — | — | @@ -294,14 +303,14 @@ |
| 295 | 304 | 'login' => intval( $wgUser->getId() ), |
| 296 | 305 | |
| 297 | 306 | // "group" is the group name(s) of the user (comma-separated). |
| 298 | | - 'group' => join( ',', $groups ), |
| | 307 | + 'group' => implode( ',', $groups ), |
| 299 | 308 | |
| 300 | 309 | // "duration" is the number of days since the user registered his (on the launching date). |
| 301 | 310 | // Note: Will be negative if user registered after launch date! |
| 302 | 311 | 'duration' => intval( $daysOld ), |
| 303 | 312 | |
| 304 | 313 | // "editcounts" is the user's total number of edits |
| 305 | | - 'editcounts' => $wgUser->getEditCount() == NULL ? 0 : intval( $wgUser->getEditCount() ), |
| | 314 | + 'editcounts' => $wgUser->getEditCount() == null ? 0 : intval( $wgUser->getEditCount() ), |
| 306 | 315 | |
| 307 | 316 | // "last6monthseditcount" is the user's total number of edits in the last 180 days (on the launching date) |
| 308 | 317 | 'last6monthseditcount' => getUserEditCountSince( |
| — | — | @@ -346,6 +355,8 @@ |
| 347 | 356 | |
| 348 | 357 | /** |
| 349 | 358 | * SiteNoticeAfter hook handler |
| | 359 | + * @param $notice string |
| | 360 | + * @return bool |
| 350 | 361 | */ |
| 351 | 362 | function efCentralNoticeDisplay( &$notice ) { |
| 352 | 363 | // setup siteNotice div |
| Index: trunk/extensions/CentralNotice/CentralNotice.db.php |
| — | — | @@ -14,6 +14,12 @@ |
| 15 | 15 | /** |
| 16 | 16 | * Return campaigns in the system within given constraints |
| 17 | 17 | * By default returns enabled campaigns, if $enabled set to false, returns both enabled and disabled campaigns |
| | 18 | + * @param $project string |
| | 19 | + * @param $language string |
| | 20 | + * @param $date string |
| | 21 | + * @param $enabled bool |
| | 22 | + * @param $preferred string |
| | 23 | + * @param $location string |
| 18 | 24 | * @return an array of ids |
| 19 | 25 | */ |
| 20 | 26 | static function getCampaigns( $project = false, $language = false, $date = false, $enabled = true, $preferred = false, $location = false ) { |
| — | — | @@ -289,7 +295,10 @@ |
| 290 | 296 | * Lookup function for active banners under a given language/project/location. This function is |
| 291 | 297 | * called by SpecialBannerListLoader::getJsonList() in order to build the banner list JSON for |
| 292 | 298 | * each project. |
| 293 | | - * @return a 2D array of running banners with associated weights and settings |
| | 299 | + * @param $project string |
| | 300 | + * @param $language string |
| | 301 | + * @param $location string |
| | 302 | + * @return array a 2D array of running banners with associated weights and settings |
| 294 | 303 | */ |
| 295 | 304 | static function getBannersByTarget( $project, $language, $location = null ) { |
| 296 | 305 | global $wgCentralDBname; |
| — | — | @@ -371,6 +380,8 @@ |
| 372 | 381 | |
| 373 | 382 | /** |
| 374 | 383 | * See if a given campaign exists in the database |
| | 384 | + * @param $campaignName string |
| | 385 | + * @return bool |
| 375 | 386 | */ |
| 376 | 387 | public static function campaignExists( $campaignName ) { |
| 377 | 388 | global $wgCentralDBname; |
| — | — | @@ -382,6 +393,8 @@ |
| 383 | 394 | |
| 384 | 395 | /** |
| 385 | 396 | * See if a given banner exists in the database |
| | 397 | + * @param $bannerName string |
| | 398 | + * @return bool |
| 386 | 399 | */ |
| 387 | 400 | public static function bannerExists( $bannerName ) { |
| 388 | 401 | global $wgCentralDBname; |
| — | — | @@ -399,6 +412,7 @@ |
| 400 | 413 | /** |
| 401 | 414 | * Return all of the available countries for geotargeting |
| 402 | 415 | * (This should probably be moved to a core database table at some point.) |
| | 416 | + * @return array |
| 403 | 417 | */ |
| 404 | 418 | static function getCountriesList() { |
| 405 | 419 | return array( |