From: Sam Reed Date: Fri, 20 May 2011 22:03:10 +0000 (+0000) Subject: Whitespace X-Git-Tag: 1.31.0-rc.0~30050 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=b214f9dd403e433dd23eab6f0e8749feaae66ce2;p=lhc%2Fweb%2Fwiklou.git Whitespace Documentation Other related stuffs --- diff --git a/includes/ChangesList.php b/includes/ChangesList.php index 59bb7b2cdb..96f9aaa4ab 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -37,7 +37,10 @@ class ChangesList { * @var Skin */ public $skin; + protected $watchlist = false; + + protected $message = array(); /** * Changeslist contructor @@ -53,7 +56,7 @@ class ChangesList { * Some users might want to use an enhanced list format, for instance * * @param $user User to fetch the list class for - * @return ChangesList derivative + * @return ChangesList|EnhancedChangesList|OldChangesList derivative */ public static function newFromUser( $user ) { global $wgRequest; @@ -111,7 +114,7 @@ class ChangesList { * unpatrolled edit. By default in English it will contain "N", "m", "b", * "!" respectively, plus it will have an appropriate title and class. * - * @param $key String: 'newpage', 'unpatrolled', 'minor', or 'bot' + * @param $flag String: 'newpage', 'unpatrolled', 'minor', or 'bot' * @return String: Raw HTML */ public static function flag( $flag ) { @@ -160,7 +163,7 @@ class ChangesList { * Show formatted char difference * @param $old Integer: bytes * @param $new Integer: bytes - * @returns String + * @return String */ public static function showCharacterDifference( $old, $new ) { global $wgRCChangedSizeThreshold, $wgLang, $wgMiserMode; @@ -638,6 +641,9 @@ class EnhancedChangesList extends ChangesList { * Format a line for enhanced recentchange (aka with javascript and block of lines). * * @param $baseRC RecentChange + * @param $watched bool + * + * @return string */ public function recentChangesLine( &$baseRC, $watched = false ) { global $wgLang, $wgUser; @@ -1201,6 +1207,8 @@ class EnhancedChangesList extends ChangesList { /** * If enhanced RC is in use, this function takes the previously cached * RC lines, arranges them, and outputs the HTML + * + * @return string */ protected function recentChangesBlock() { if( count ( $this->rc_cache ) == 0 ) { diff --git a/includes/api/ApiImport.php b/includes/api/ApiImport.php index 5c05daf321..57c707b478 100644 --- a/includes/api/ApiImport.php +++ b/includes/api/ApiImport.php @@ -176,6 +176,14 @@ class ApiImport extends ApiBase { class ApiImportReporter extends ImportReporter { private $mResultArr = array(); + /** + * @param $title Title + * @param $origTitle Title + * @param $revisionCount int + * @param $successCount int + * @param $pageInfo + * @return void + */ function reportPage( $title, $origTitle, $revisionCount, $successCount, $pageInfo ) { // Add a result entry $r = array(); diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php index 7e68ad1de1..cd9478bb5d 100644 --- a/includes/specials/SpecialUndelete.php +++ b/includes/specials/SpecialUndelete.php @@ -80,6 +80,11 @@ class PageArchive { return self::listPages( $dbr, $conds ); } + /** + * @param $dbr DatabaseBase + * @param $condition + * @return bool|ResultWrapper + */ protected static function listPages( $dbr, $condition ) { return $dbr->resultObject( $dbr->select( @@ -981,7 +986,7 @@ class SpecialUndelete extends SpecialPage { $targetQuery = array( 'oldid' => $rev->getId() ); } // Add show/hide deletion links if available - $del .= $this->revDeleteLink( $rev ); + $del = $this->revDeleteLink( $rev ); return '
' . $sk->link( diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php index b2ade1c632..f0529bbc05 100644 --- a/includes/specials/SpecialWatchlist.php +++ b/includes/specials/SpecialWatchlist.php @@ -39,7 +39,7 @@ class SpecialWatchlist extends SpecialPage { // Add feed links $wlToken = $wgUser->getOption( 'watchlisttoken' ); - if (!$wlToken) { + if ( !$wlToken ) { $wlToken = sha1( mt_rand() . microtime( true ) ); $wgUser->setOption( 'watchlisttoken', $wlToken ); $wgUser->saveSettings(); @@ -82,7 +82,8 @@ class SpecialWatchlist extends SpecialPage { ); $wgOut->setSubtitle( $sub ); - if( ( $mode = SpecialEditWatchlist::getMode( $wgRequest, $par ) ) !== false ) { + $mode = SpecialEditWatchlist::getMode( $wgRequest, $par ); + if( $mode !== false ) { # TODO: localise? switch( $mode ){ case SpecialEditWatchlist::EDIT_CLEAR: @@ -100,7 +101,7 @@ class SpecialWatchlist extends SpecialPage { } $uid = $wgUser->getId(); - if( ($wgEnotifWatchlist || $wgShowUpdatedMarker) && $wgRequest->getVal( 'reset' ) && + if( ( $wgEnotifWatchlist || $wgShowUpdatedMarker ) && $wgRequest->getVal( 'reset' ) && $wgRequest->wasPosted() ) { $wgUser->clearAllNotifications( $uid ); @@ -172,7 +173,7 @@ class SpecialWatchlist extends SpecialPage { $days = $defaults['days']; # default cutoff for shortlisters } } else { - $days = floatval($days); + $days = floatval( $days ); } // Dump everything here @@ -284,7 +285,7 @@ class SpecialWatchlist extends SpecialPage { if ( $usePage || $rollbacker ) { $tables[] = 'page'; $join_conds['page'] = array('LEFT JOIN','rc_cur_id=page_id'); - if ($rollbacker) { + if ( $rollbacker ) { $fields[] = 'page_latest'; } } @@ -309,7 +310,7 @@ class SpecialWatchlist extends SpecialPage { } elseif( $days > 0 ) { $wlInfo = wfMsgExt( 'wlnote', 'parseinline', $wgLang->formatNum( $numRows ), - $wgLang->formatNum( round($days*24) ) + $wgLang->formatNum( round( $days * 24 ) ) ) . '
'; } @@ -396,7 +397,7 @@ class SpecialWatchlist extends SpecialPage { $updated = false; } - if ($wgRCShowWatchingUsers && $wgUser->getOption( 'shownumberswatching' )) { + if ( $wgRCShowWatchingUsers && $wgUser->getOption( 'shownumberswatching' ) ) { $rc->numberofWatchingusers = $dbr->selectField( 'watchlist', 'COUNT(*)', array( @@ -434,7 +435,7 @@ class SpecialWatchlist extends SpecialPage { $sk = $wgUser->getSkin(); $title = Title::newFromText( $wgContLang->specialPage( $page ) ); - $options['days'] = ($h / 24.0); + $options['days'] = ( $h / 24.0 ); return $sk->linkKnown( $title, @@ -450,7 +451,7 @@ class SpecialWatchlist extends SpecialPage { $sk = $wgUser->getSkin(); $title = Title::newFromText( $wgContLang->specialPage( $page ) ); $options['days'] = $d; - $message = ($d ? $wgLang->formatNum( $d ) : wfMsgHtml( 'watchlistall2' ) ); + $message = ( $d ? $wgLang->formatNum( $d ) : wfMsgHtml( 'watchlistall2' ) ); return $sk->linkKnown( $title, @@ -462,6 +463,8 @@ class SpecialWatchlist extends SpecialPage { /** * Returns html + * + * @return string */ protected static function cutoffLinks( $days, $page = 'Watchlist', $options = array() ) { global $wgLang; diff --git a/maintenance/generateSitemap.php b/maintenance/generateSitemap.php index 28cdd639fb..84c3d6a4fe 100644 --- a/maintenance/generateSitemap.php +++ b/maintenance/generateSitemap.php @@ -133,7 +133,6 @@ class GenerateSitemap extends Maintenance { */ public function __construct() { parent::__construct(); - global $wgDBname; $this->mDescription = "Creates a sitemap for the site"; $this->addOption( 'fspath', 'The file system path to save to, e.g. /tmp/sitemap; defaults to current directory', false, true ); $this->addOption( 'urlpath', 'The URL path corresponding to --fspath, prepended to filenames in the index; defaults to an empty string', false, true ); diff --git a/maintenance/language/languages.inc b/maintenance/language/languages.inc index eb30864367..60b1112fdf 100644 --- a/maintenance/language/languages.inc +++ b/maintenance/language/languages.inc @@ -88,7 +88,7 @@ class languages { /** * Load the language file. * - * @param $code The language code. + * @param $code string The language code. */ protected function loadFile( $code ) { if ( isset( $this->mRawMessages[$code] ) &&