From 2ae155da529023280de74d9caffa7a32e7934082 Mon Sep 17 00:00:00 2001 From: Ricordisamoa Date: Thu, 8 Jan 2015 20:11:57 +0100 Subject: [PATCH] Fix phpcs errors in includes/ Mostly Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines Change-Id: I678b2f0902f11cd1dfa1611b9da24e7237df9122 --- includes/Category.php | 5 ----- includes/EditPage.php | 10 ---------- includes/HttpFunctions.php | 2 -- includes/Linker.php | 1 - includes/MediaWiki.php | 4 ---- includes/OutputPage.php | 3 --- includes/Revision.php | 3 --- includes/Sanitizer.php | 1 - includes/Title.php | 1 - includes/User.php | 1 - includes/actions/CreditsAction.php | 2 -- includes/actions/HistoryAction.php | 1 - includes/actions/InfoAction.php | 1 - includes/api/ApiParse.php | 1 - includes/cache/BacklinkCache.php | 1 - includes/cache/LinkCache.php | 2 -- includes/cache/LocalisationCache.php | 4 ---- includes/cache/MessageCache.php | 4 ---- includes/changes/EnhancedChangesList.php | 5 ----- includes/changes/OldChangesList.php | 1 - includes/content/WikitextContent.php | 1 - includes/db/DatabaseMysqlBase.php | 5 ----- includes/db/LoadBalancer.php | 1 - includes/db/LoadMonitor.php | 1 - includes/deferred/DeferredUpdates.php | 1 - includes/deferred/SearchUpdate.php | 1 - includes/deferred/SquidUpdate.php | 1 - includes/filebackend/FSFile.php | 2 -- includes/filerepo/file/File.php | 1 - includes/filerepo/file/LocalFile.php | 3 --- includes/libs/Xhprof.php | 2 +- includes/libs/composer/ComposerJson.php | 2 +- includes/mail/EmailNotification.php | 1 - includes/media/FormatMetadata.php | 5 ----- includes/page/Article.php | 6 ------ includes/page/WikiPage.php | 4 ---- includes/parser/LinkHolderArray.php | 1 - includes/parser/Parser.php | 2 -- includes/parser/ParserOptions.php | 1 - includes/parser/Preprocessor_DOM.php | 2 -- includes/registration/ExtensionProcessor.php | 2 -- includes/resourceloader/ResourceLoader.php | 7 ------- includes/search/SearchHighlighter.php | 3 --- includes/search/SearchMySQL.php | 2 -- includes/skins/Skin.php | 1 - includes/skins/SkinTemplate.php | 11 ----------- includes/specials/SpecialAllMessages.php | 2 -- includes/specials/SpecialContributions.php | 1 - includes/specials/SpecialDeletedContributions.php | 1 - includes/specials/SpecialListusers.php | 2 +- includes/specials/SpecialMergeHistory.php | 1 - includes/specials/SpecialProtectedtitles.php | 1 - includes/specials/SpecialVersion.php | 2 -- includes/upload/UploadBase.php | 7 ------- includes/utils/MWCryptRand.php | 1 - 55 files changed, 3 insertions(+), 137 deletions(-) diff --git a/includes/Category.php b/includes/Category.php index 2521a65a4a..3a21e256c7 100644 --- a/includes/Category.php +++ b/includes/Category.php @@ -60,7 +60,6 @@ class Category { return true; } - $dbr = wfGetDB( DB_SLAVE ); $row = $dbr->selectRow( 'category', @@ -69,7 +68,6 @@ class Category { __METHOD__ ); - if ( !$row ) { # Okay, there were no contents. Nothing to initialize. if ( $this->mTitle ) { @@ -281,7 +279,6 @@ class Category { ) ); - return $result; } @@ -314,7 +311,6 @@ class Category { } } - $dbw = wfGetDB( DB_MASTER ); $dbw->startAtomic( __METHOD__ ); @@ -358,7 +354,6 @@ class Category { ); $dbw->endAtomic( __METHOD__ ); - # Now we should update our local counts. $this->mPages = $result->pages; $this->mSubcats = $result->subcats; diff --git a/includes/EditPage.php b/includes/EditPage.php index 8e433e4373..cb79fd1b77 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -515,7 +515,6 @@ class EditPage { return; } - $this->isConflict = false; // css / js subpages of user pages get a special treatment $this->isCssJsSubpage = $this->mTitle->isCssJsSubpage(); @@ -721,7 +720,6 @@ class EditPage { function importFormData( &$request ) { global $wgContLang, $wgUser; - # Section edit can come from either the form or a link $this->section = $request->getVal( 'wpSection', $request->getVal( 'section' ) ); @@ -975,7 +973,6 @@ class EditPage { protected function getContentObject( $def_content = null ) { global $wgOut, $wgRequest, $wgUser, $wgContLang; - $content = false; // For message page not locally set, use the i18n message. @@ -1519,7 +1516,6 @@ class EditPage { $status = Status::newGood(); - if ( !Hooks::run( 'EditPage::attemptSave', array( $this ) ) ) { wfDebug( "Hook 'EditPage::attemptSave' aborted article saving\n" ); $status->fatal( 'hookaborted' ); @@ -1565,7 +1561,6 @@ class EditPage { $code = $wgUser->isAnon() ? self::AS_IMAGE_REDIRECT_ANON : self::AS_IMAGE_REDIRECT_LOGGED; $status->setResult( false, $code ); - return $status; } @@ -1663,7 +1658,6 @@ class EditPage { return $status; } - # Load the page data from the master. If anything changes in the meantime, # we detect it by using page_latest like a token in a 1 try compare-and-swap. $this->mArticle->loadPageData( 'fromdbmaster' ); @@ -2302,7 +2296,6 @@ class EditPage { function showEditForm( $formCallback = null ) { global $wgOut, $wgUser; - # need to parse the preview early so that we know which templates are used, # otherwise users with "show preview after edit box" will get a blank list # we parse this near the beginning so that setHeaders can do the title @@ -3176,7 +3169,6 @@ HTML return ''; } - $limitReport = Html::rawElement( 'div', array( 'class' => 'mw-limitReportExplanation' ), wfMessage( 'limitreport-title' )->parseAsBlock() ); @@ -3211,7 +3203,6 @@ HTML Html::closeElement( 'table' ) . Html::closeElement( 'div' ); - return $limitReport; } @@ -3397,7 +3388,6 @@ HTML global $wgOut, $wgUser, $wgRawHtml, $wgLang; global $wgAllowUserCss, $wgAllowUserJs; - if ( $wgRawHtml && !$this->mTokenOk ) { // Could be an offsite preview attempt. This is very unsafe if // HTML is enabled, as it could be an attack. diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php index 43dd2b2789..d066df89e6 100644 --- a/includes/HttpFunctions.php +++ b/includes/HttpFunctions.php @@ -786,7 +786,6 @@ class CurlHttpRequest extends MWHttpRequest { $this->parseHeader(); $this->setStatus(); - return $this->status; } @@ -953,7 +952,6 @@ class PhpHttpRequest extends MWHttpRequest { } fclose( $fh ); - return $this->status; } } diff --git a/includes/Linker.php b/includes/Linker.php index 7b7c21b4ad..10c6804b18 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -2313,7 +2313,6 @@ class Linker { ) { wfDeprecated( __METHOD__, '1.21' ); - if ( $text == '' ) { $text = self::linkText( $title ); } diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index 3fe656e1d5..d94443b4b7 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -157,7 +157,6 @@ class MediaWiki { private function performRequest() { global $wgTitle; - $request = $this->context->getRequest(); $requestTitle = $title = $this->context->getTitle(); $output = $this->context->getOutput(); @@ -457,7 +456,6 @@ class MediaWiki { echo "Waiting for a database server: $lag seconds lagged\n"; } - exit; } } @@ -467,7 +465,6 @@ class MediaWiki { private function main() { global $wgTitle; - $request = $this->context->getRequest(); // Send Ajax requests to the Ajax dispatcher. @@ -601,7 +598,6 @@ class MediaWiki { return; // recursion guard } - if ( $jobRunRate < 1 ) { $max = mt_getrandmax(); if ( mt_rand( 0, $max ) > $max * $jobRunRate ) { diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 7b795068b8..4e14b7b247 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -1685,7 +1685,6 @@ class OutputPage extends ContextSource { ) { global $wgParser; - $popts = $this->parserOptions(); $oldTidy = $popts->setTidy( $tidy ); $popts->setInterfaceMessage( (bool)$interface ); @@ -2171,7 +2170,6 @@ class OutputPage extends ContextSource { return; } - $response = $this->getRequest()->response(); $config = $this->getConfig(); @@ -2619,7 +2617,6 @@ class OutputPage extends ContextSource { public function headElement( Skin $sk, $includeStyle = true ) { global $wgContLang; - $userdir = $this->getLanguage()->getDir(); $sitedir = $wgContLang->getDir(); diff --git a/includes/Revision.php b/includes/Revision.php index 6ec7eaf5b6..c8015e62b6 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -1325,7 +1325,6 @@ class Revision implements IDBAccessObject { public function insertOn( $dbw ) { global $wgDefaultExternalStore, $wgContentHandlerUseDB; - $this->checkContentModel(); $data = $this->mText; @@ -1536,7 +1535,6 @@ class Revision implements IDBAccessObject { $wgMemc->set( $key, $text, $wgRevisionCacheExpiry ); } - return $text; } @@ -1558,7 +1556,6 @@ class Revision implements IDBAccessObject { public static function newNullRevision( $dbw, $pageId, $summary, $minor, $user = null ) { global $wgContentHandlerUseDB; - $fields = array( 'page_latest', 'page_namespace', 'page_title', 'rev_text_id', 'rev_len', 'rev_sha1' ); diff --git a/includes/Sanitizer.php b/includes/Sanitizer.php index e173e6a6e7..6942ac0d1d 100644 --- a/includes/Sanitizer.php +++ b/includes/Sanitizer.php @@ -372,7 +372,6 @@ class Sanitizer { static $htmlpairsStatic, $htmlsingle, $htmlsingleonly, $htmlnest, $tabletags, $htmllist, $listtags, $htmlsingleallowed, $htmlelementsStatic, $staticInitialised; - // Base our staticInitialised variable off of the global config state so that if the globals // are changed (like in the screwed up test system) we will re-initialise the settings. $globalContext = implode( '-', compact( 'wgAllowMicrodataAttributes', 'wgAllowImageTag' ) ); diff --git a/includes/Title.php b/includes/Title.php index 2adda65a03..0cac64ab17 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -2717,7 +2717,6 @@ class Title { return array( $this->mHasCascadingRestrictions, $pagerestrictions ); } - $dbr = wfGetDB( DB_SLAVE ); if ( $this->getNamespace() == NS_FILE ) { diff --git a/includes/User.php b/includes/User.php index 0c6b15f3b0..7ca7d807cd 100644 --- a/includes/User.php +++ b/includes/User.php @@ -3792,7 +3792,6 @@ class User implements IDBAccessObject { public function checkPassword( $password ) { global $wgAuth, $wgLegacyEncoding; - $this->loadPasswords(); // Certain authentication plugins do NOT want to save diff --git a/includes/actions/CreditsAction.php b/includes/actions/CreditsAction.php index 69c856d554..c19e8fa388 100644 --- a/includes/actions/CreditsAction.php +++ b/includes/actions/CreditsAction.php @@ -49,7 +49,6 @@ class CreditsAction extends FormlessAction { $s = $this->getCredits( -1 ); } - return Html::rawElement( 'div', array( 'id' => 'mw-credits' ), $s ); } @@ -70,7 +69,6 @@ class CreditsAction extends FormlessAction { } } - return $s; } diff --git a/includes/actions/HistoryAction.php b/includes/actions/HistoryAction.php index 06f3bae384..1e2f88937e 100644 --- a/includes/actions/HistoryAction.php +++ b/includes/actions/HistoryAction.php @@ -102,7 +102,6 @@ class HistoryAction extends FormlessAction { return; // Client cache fresh and headers sent, nothing more to do. } - $this->preCacheMessages(); $config = $this->context->getConfig(); diff --git a/includes/actions/InfoAction.php b/includes/actions/InfoAction.php index 948d289ef1..9e4a150ed4 100644 --- a/includes/actions/InfoAction.php +++ b/includes/actions/InfoAction.php @@ -746,7 +746,6 @@ class InfoAction extends FormlessAction { __METHOD__ ); - return $result; } diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index 74d1d9a4b2..83d2cbc0bd 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -426,7 +426,6 @@ class ApiParse extends ApiBase { $popts->setIsSectionPreview( $params['sectionpreview'] ); $popts->setEditSection( !$params['disableeditsection'] ); - return $popts; } diff --git a/includes/cache/BacklinkCache.php b/includes/cache/BacklinkCache.php index 4f35c9023a..c6d9a185d4 100644 --- a/includes/cache/BacklinkCache.php +++ b/includes/cache/BacklinkCache.php @@ -230,7 +230,6 @@ class BacklinkCache { } } - return $res; } diff --git a/includes/cache/LinkCache.php b/includes/cache/LinkCache.php index 492905acdd..eace1eeaea 100644 --- a/includes/cache/LinkCache.php +++ b/includes/cache/LinkCache.php @@ -218,7 +218,6 @@ class LinkCache { public function addLinkObj( $nt ) { global $wgContentHandlerUseDB; - $key = $nt->getPrefixedDBkey(); if ( $this->isBadLink( $key ) || $nt->isExternal() ) { @@ -259,7 +258,6 @@ class LinkCache { $id = 0; } - return $id; } diff --git a/includes/cache/LocalisationCache.php b/includes/cache/LocalisationCache.php index 4da379b89b..e270f5f46a 100644 --- a/includes/cache/LocalisationCache.php +++ b/includes/cache/LocalisationCache.php @@ -559,7 +559,6 @@ class LocalisationCache { } } - // The JSON format only supports messages, none of the other variables, so wrap the data return array( 'messages' => $data ); } @@ -705,7 +704,6 @@ class LocalisationCache { $deps['plurals'] = new FileDependency( "$IP/languages/data/plurals.xml" ); $deps['plurals-mw'] = new FileDependency( "$IP/languages/data/plurals-mediawiki.xml" ); - return $data; } @@ -855,7 +853,6 @@ class LocalisationCache { $codeSequence = array_merge( array( $code ), $coreData['fallbackSequence'] ); $messageDirs = $this->getMessagesDirs(); - # Load non-JSON localisation data for extensions $extensionData = array_combine( $codeSequence, @@ -952,7 +949,6 @@ class LocalisationCache { } } - # Add cache dependencies for any referenced globals $deps['wgExtensionMessagesFiles'] = new GlobalDependency( 'wgExtensionMessagesFiles' ); // $wgMessagesDirs is used in LocalisationCache::getMessagesDirs() diff --git a/includes/cache/MessageCache.php b/includes/cache/MessageCache.php index 4f00cb2b8b..04f588776f 100644 --- a/includes/cache/MessageCache.php +++ b/includes/cache/MessageCache.php @@ -310,7 +310,6 @@ class MessageCache { $success = true; } - if ( $success ) { # Done, no need to retry break; @@ -617,7 +616,6 @@ class MessageCache { $this->saveToLocal( $serialized, $hash, $code ); } - return $success; } @@ -695,7 +693,6 @@ class MessageCache { function get( $key, $useDB = true, $langcode = true, $isFullKey = false ) { global $wgContLang; - if ( is_int( $key ) ) { // Fix numerical strings that somehow become ints // on their way here @@ -1058,7 +1055,6 @@ class MessageCache { $res = $parser->parse( $text, $title, $popts, $linestart ); $this->mInParser = false; - return $res; } diff --git a/includes/changes/EnhancedChangesList.php b/includes/changes/EnhancedChangesList.php index b39bca3ba4..2cee726308 100644 --- a/includes/changes/EnhancedChangesList.php +++ b/includes/changes/EnhancedChangesList.php @@ -109,7 +109,6 @@ class EnhancedChangesList extends ChangesList { $cacheEntry = $this->cacheEntryFactory->newFromRecentChange( $baseRC, $watched ); $this->addCacheEntry( $cacheEntry ); - return $ret; } @@ -466,7 +465,6 @@ class EnhancedChangesList extends ChangesList { $this->rcCacheIndex++; - return $r; } @@ -548,7 +546,6 @@ class EnhancedChangesList extends ChangesList { $r .= "\n"; - return $r; } @@ -563,7 +560,6 @@ class EnhancedChangesList extends ChangesList { return ''; } - $blockOut = ''; foreach ( $this->rc_cache as $block ) { if ( count( $block ) < 2 ) { @@ -573,7 +569,6 @@ class EnhancedChangesList extends ChangesList { } } - return '
' . $blockOut . '
'; } diff --git a/includes/changes/OldChangesList.php b/includes/changes/OldChangesList.php index 2797d81d81..4ce564d1e4 100644 --- a/includes/changes/OldChangesList.php +++ b/includes/changes/OldChangesList.php @@ -59,7 +59,6 @@ class OldChangesList extends ChangesList { return false; } - $dateheader = ''; // $html now contains only
  • ...
  • , for hooks' convenience. $this->insertDateHeader( $dateheader, $rc->mAttribs['rc_timestamp'] ); diff --git a/includes/content/WikitextContent.php b/includes/content/WikitextContent.php index e774735531..dbe09f91c9 100644 --- a/includes/content/WikitextContent.php +++ b/includes/content/WikitextContent.php @@ -104,7 +104,6 @@ class WikitextContent extends TextContent { $newContent = new static( $text ); - return $newContent; } diff --git a/includes/db/DatabaseMysqlBase.php b/includes/db/DatabaseMysqlBase.php index 071bf96f3b..f02aa93a41 100644 --- a/includes/db/DatabaseMysqlBase.php +++ b/includes/db/DatabaseMysqlBase.php @@ -71,7 +71,6 @@ abstract class DatabaseMysqlBase extends DatabaseBase { $this->mPassword = $password; $this->mDBname = $dbName; - # The kernel's default SYN retransmission period is far too slow for us, # so we use a short timeout plus a manual retry. Retrying means that a small # but finite rate of SYN packet loss won't cause user-visible errors. @@ -85,7 +84,6 @@ abstract class DatabaseMysqlBase extends DatabaseBase { } $error = $this->restoreErrorHandler(); - # Always log connection errors if ( !$this->mConn ) { if ( !$error ) { @@ -102,7 +100,6 @@ abstract class DatabaseMysqlBase extends DatabaseBase { "Server: $server, User: $user, Password: " . substr( $password, 0, 3 ) . "..., error: " . $error . "\n" ); - $this->reportConnectionError( $error ); } @@ -120,7 +117,6 @@ abstract class DatabaseMysqlBase extends DatabaseBase { wfDebug( "Error selecting database $dbName on server {$this->mServer} " . "from client host " . wfHostname() . "\n" ); - $this->reportConnectionError( "Error selecting database $dbName" ); } } @@ -698,7 +694,6 @@ abstract class DatabaseMysqlBase extends DatabaseBase { } } - return $status; } diff --git a/includes/db/LoadBalancer.php b/includes/db/LoadBalancer.php index f789d56ac1..8618ae6ab4 100644 --- a/includes/db/LoadBalancer.php +++ b/includes/db/LoadBalancer.php @@ -501,7 +501,6 @@ class LoadBalancer { return $this->reportConnectionError(); } - return $conn; } diff --git a/includes/db/LoadMonitor.php b/includes/db/LoadMonitor.php index 39b9531649..91840dd952 100644 --- a/includes/db/LoadMonitor.php +++ b/includes/db/LoadMonitor.php @@ -93,7 +93,6 @@ class LoadMonitorMySQL implements LoadMonitor { return array( 0 => 0 ); } - $expiry = 5; $requestRate = 10; diff --git a/includes/deferred/DeferredUpdates.php b/includes/deferred/DeferredUpdates.php index f0930d7631..93c53adbb1 100644 --- a/includes/deferred/DeferredUpdates.php +++ b/includes/deferred/DeferredUpdates.php @@ -82,7 +82,6 @@ class DeferredUpdates { public static function doUpdates( $commit = '' ) { global $wgDeferredUpdateList; - $updates = array_merge( $wgDeferredUpdateList, self::$updates ); // No need to get master connections in case of empty updates array diff --git a/includes/deferred/SearchUpdate.php b/includes/deferred/SearchUpdate.php index ff0d0aa753..ba14f09947 100644 --- a/includes/deferred/SearchUpdate.php +++ b/includes/deferred/SearchUpdate.php @@ -78,7 +78,6 @@ class SearchUpdate implements DeferrableUpdate { return; } - $page = WikiPage::newFromID( $this->id, WikiPage::READ_LATEST ); foreach ( SearchEngine::getSearchTypes() as $type ) { diff --git a/includes/deferred/SquidUpdate.php b/includes/deferred/SquidUpdate.php index 78fbee1e5e..950a264ac5 100644 --- a/includes/deferred/SquidUpdate.php +++ b/includes/deferred/SquidUpdate.php @@ -110,7 +110,6 @@ class SquidUpdate { self::HTCPPurge( $urlArr ); } - // Remove duplicate URLs $urlArr = array_unique( $urlArr ); // Maximum number of parallel connections per squid diff --git a/includes/filebackend/FSFile.php b/includes/filebackend/FSFile.php index 06c43ec191..6ee9b2e06a 100644 --- a/includes/filebackend/FSFile.php +++ b/includes/filebackend/FSFile.php @@ -145,7 +145,6 @@ class FSFile { wfDebug( __METHOD__ . ": $this->path NOT FOUND!\n" ); } - return $info; } @@ -213,7 +212,6 @@ class FSFile { $this->sha1Base36 = wfBaseConvert( $this->sha1Base36, 16, 36, 31 ); } - return $this->sha1Base36; } diff --git a/includes/filerepo/file/File.php b/includes/filerepo/file/File.php index f8cc0077e7..6d60012e7a 100644 --- a/includes/filerepo/file/File.php +++ b/includes/filerepo/file/File.php @@ -1070,7 +1070,6 @@ abstract class File { } } while ( false ); - return is_object( $thumb ) ? $thumb : false; } diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index 47be4d2d52..b2e5b00fa4 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -278,7 +278,6 @@ class LocalFile extends File { wfIncrStats( 'image_cache_miss' ); } - return $this->dataLoaded; } @@ -1444,7 +1443,6 @@ class LocalFile extends File { $dbw->commit( __METHOD__ ); // commit before anything bad can happen } - if ( $reupload ) { # Delete old thumbnails $this->purgeThumbnails(); @@ -1463,7 +1461,6 @@ class LocalFile extends File { LinksUpdate::queueRecursiveJobsForTable( $this->getTitle(), 'imagelinks' ); } - return true; } diff --git a/includes/libs/Xhprof.php b/includes/libs/Xhprof.php index 98ff675c89..5ed67c7323 100644 --- a/includes/libs/Xhprof.php +++ b/includes/libs/Xhprof.php @@ -321,7 +321,7 @@ class Xhprof { $this->complete[$func]['subcalls'] = array(); } - foreach( $this->hieraData as $key => $stats ) { + foreach ( $this->hieraData as $key => $stats ) { list( $parent, $child ) = self::splitKey( $key ); if ( $parent !== null ) { // Track call tree information diff --git a/includes/libs/composer/ComposerJson.php b/includes/libs/composer/ComposerJson.php index 478616515a..49c9f23a29 100644 --- a/includes/libs/composer/ComposerJson.php +++ b/includes/libs/composer/ComposerJson.php @@ -51,4 +51,4 @@ class ComposerJson { return $version; } -} \ No newline at end of file +} diff --git a/includes/mail/EmailNotification.php b/includes/mail/EmailNotification.php index 6baa180dac..81c4e38d32 100644 --- a/includes/mail/EmailNotification.php +++ b/includes/mail/EmailNotification.php @@ -205,7 +205,6 @@ class EmailNotification { global $wgEnotifWatchlist; global $wgEnotifMinorEdits, $wgEnotifUserTalk; - # The following code is only run, if several conditions are met: # 1. EmailNotification for pages (other than user_talk pages) must be enabled # 2. minor edits (changes) are only regarded if the global flag indicates so diff --git a/includes/media/FormatMetadata.php b/includes/media/FormatMetadata.php index b755c5a031..e8e73af18f 100644 --- a/includes/media/FormatMetadata.php +++ b/includes/media/FormatMetadata.php @@ -1595,7 +1595,6 @@ class FormatMetadata extends ContextSource { public function fetchExtendedMetadata( File $file ) { global $wgMemc; - // If revision deleted, exit immediately if ( $file->isDeleted( File::DELETED_FILE ) ) { @@ -1632,7 +1631,6 @@ class FormatMetadata extends ContextSource { $wgMemc->set( $cacheKey, $valueToCache, $maxCacheTime ); } - return $extendedMetadata; } @@ -1654,7 +1652,6 @@ class FormatMetadata extends ContextSource { return $file->getExtendedMetadata() ?: array(); } - $uploadDate = wfTimestamp( TS_ISO_8601, $file->getTimestamp() ); $fileMetadata = array( @@ -1693,7 +1690,6 @@ class FormatMetadata extends ContextSource { } } - return $fileMetadata; } @@ -1726,7 +1722,6 @@ class FormatMetadata extends ContextSource { } } - return $extendedMetadata; } diff --git a/includes/page/Article.php b/includes/page/Article.php index a8633e8162..5a09e656b5 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -342,7 +342,6 @@ class Article implements Page { return $this->mContent; } - $content = $this->fetchContentObject(); if ( !$content ) { @@ -353,7 +352,6 @@ class Article implements Page { $this->mContent = ContentHandler::getContentText( $content ); ContentHandler::runLegacyHooks( 'ArticleAfterFetchContent', array( &$this, &$this->mContent ) ); - return $this->mContent; } @@ -374,7 +372,6 @@ class Article implements Page { return $this->mContentObject; } - $this->mContentLoaded = true; $this->mContent = null; @@ -421,7 +418,6 @@ class Article implements Page { Hooks::run( 'ArticleAfterFetchContentObject', array( &$this, &$this->mContentObject ) ); - return $this->mContentObject; } @@ -472,7 +468,6 @@ class Article implements Page { public function view() { global $wgUseFileCache, $wgUseETag, $wgDebugToolbar, $wgMaxRedirects; - # Get variables from query string # As side effect this will load the revision and update the title # in a revision ID is passed in the request, so this should remain @@ -1080,7 +1075,6 @@ class Article implements Page { return false; } - // New page patrol: Get the timestamp of the oldest revison which // the revision table holds for the given page. Then we look // whether it's within the RC lifespan and if it is, we try diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index a8229454a7..fa54f7cbec 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -1145,7 +1145,6 @@ class WikiPage implements Page, IDBAccessObject { $pool = new PoolWorkArticleView( $this, $parserOptions, $oldid, $useParserCache ); $pool->execute(); - return $pool->getParserOutput(); } @@ -1264,7 +1263,6 @@ class WikiPage implements Page, IDBAccessObject { ) { global $wgContentHandlerUseDB; - $content = $revision->getContent(); $len = $content ? $content->getSize() : 0; $rt = $content ? $content->getUltimateRedirectTarget() : null; @@ -1702,7 +1700,6 @@ class WikiPage implements Page, IDBAccessObject { throw new MWException( 'Something is trying to edit an article with an empty title' ); } - if ( !$content->getContentHandler()->canBeUsedOn( $this->getTitle() ) ) { return Status::newFatal( 'content-not-allowed-here', ContentHandler::getLocalizedName( $content->getModel() ), @@ -2132,7 +2129,6 @@ class WikiPage implements Page, IDBAccessObject { public function doEditUpdates( Revision $revision, User $user, array $options = array() ) { global $wgEnableParserCache; - $options += array( 'changed' => true, 'created' => false, diff --git a/includes/parser/LinkHolderArray.php b/includes/parser/LinkHolderArray.php index 0cc02098cd..7026c5ce39 100644 --- a/includes/parser/LinkHolderArray.php +++ b/includes/parser/LinkHolderArray.php @@ -271,7 +271,6 @@ class LinkHolderArray { $this->replaceInternal( $text ); $this->replaceInterwiki( $text ); - } /** diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index fcdf68cbc8..7703c4bb22 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -299,7 +299,6 @@ class Parser { } $this->mFirstCall = false; - CoreParserFunctions::register( $this ); CoreTagHooks::register( $this ); $this->initialiseVariables(); @@ -1189,7 +1188,6 @@ class Parser { $out = ''; } - return $out; } diff --git a/includes/parser/ParserOptions.php b/includes/parser/ParserOptions.php index ffcde30329..b09fe76029 100644 --- a/includes/parser/ParserOptions.php +++ b/includes/parser/ParserOptions.php @@ -639,7 +639,6 @@ class ParserOptions { $wgCleanSignatures, $wgExternalLinkTarget, $wgExpensiveParserFunctionLimit, $wgMaxGeneratedPPNodeCount, $wgDisableLangConversion, $wgDisableTitleConversion; - // *UPDATE* ParserOptions::matches() if any of this changes as needed $this->mInterwikiMagic = $wgInterwikiMagic; $this->mAllowExternalImages = $wgAllowExternalImages; diff --git a/includes/parser/Preprocessor_DOM.php b/includes/parser/Preprocessor_DOM.php index 5b7196877d..343588191b 100644 --- a/includes/parser/Preprocessor_DOM.php +++ b/includes/parser/Preprocessor_DOM.php @@ -203,7 +203,6 @@ class Preprocessor_DOM implements Preprocessor { if ( $cacheable ) { } - if ( !$result ) { throw new MWException( __METHOD__ . ' generated invalid XML' ); } @@ -752,7 +751,6 @@ class Preprocessor_DOM implements Preprocessor { $stack->rootAccum .= ''; $xml = $stack->rootAccum; - return $xml; } } diff --git a/includes/registration/ExtensionProcessor.php b/includes/registration/ExtensionProcessor.php index f42e9f3ee5..459d95b17b 100644 --- a/includes/registration/ExtensionProcessor.php +++ b/includes/registration/ExtensionProcessor.php @@ -133,8 +133,6 @@ class ExtensionProcessor implements Processor { } } - - } public function getExtractedInfo() { diff --git a/includes/resourceloader/ResourceLoader.php b/includes/resourceloader/ResourceLoader.php index aecd827474..15bb13f4cb 100644 --- a/includes/resourceloader/ResourceLoader.php +++ b/includes/resourceloader/ResourceLoader.php @@ -212,7 +212,6 @@ class ResourceLoader { $this->errors[] = self::formatExceptionNoComment( $e ); } - return $result; } @@ -225,7 +224,6 @@ class ResourceLoader { public function __construct( Config $config = null ) { global $IP; - if ( $config === null ) { wfDebug( __METHOD__ . ' was called without providing a Config instance' ); $config = ConfigFactory::getDefaultInstance()->makeConfig( 'main' ); @@ -360,7 +358,6 @@ class ResourceLoader { . 'Edit your LocalSettings.php to enable it.' ); } - // Get core test suites $testModules = array(); $testModules['qunit'] = array(); @@ -566,7 +563,6 @@ class ResourceLoader { // See http://bugs.php.net/bug.php?id=36514 ob_start(); - // Find out which modules are missing and instantiate the others $modules = array(); $missing = array(); @@ -595,7 +591,6 @@ class ResourceLoader { $this->errors[] = self::formatExceptionNoComment( $e ); } - // To send Last-Modified and support If-Modified-Since, we need to detect // the last modified time $mtime = wfTimestamp( TS_UNIX, $this->config->get( 'CacheEpoch' ) ); @@ -613,7 +608,6 @@ class ResourceLoader { } } - // If there's an If-Modified-Since header, respond with a 304 appropriately if ( $this->tryRespondLastModified( $context, $mtime ) ) { return; // output handled (buffers cleared) @@ -862,7 +856,6 @@ class ResourceLoader { no modules were requested. Max made me put this here. */"; } - $image = $context->getImageObj(); if ( $image ) { $data = $image->getImageData( $context ); diff --git a/includes/search/SearchHighlighter.php b/includes/search/SearchHighlighter.php index 1641fb9275..255d005cc4 100644 --- a/includes/search/SearchHighlighter.php +++ b/includes/search/SearchHighlighter.php @@ -131,7 +131,6 @@ class SearchHighlighter { $all = $textExt + $otherExt; // these have disjunct key sets - // prepare regexps foreach ( $terms as $index => $term ) { // manually do upper/lowercase stuff for utf-8 since PHP won't do it @@ -161,7 +160,6 @@ class SearchHighlighter { $pat1 = "/(" . $phrase . ")/ui"; $pat2 = "/$patPre(" . $anyterm . ")$patPost/ui"; - $left = $contextlines; $snippets = array(); @@ -284,7 +282,6 @@ class SearchHighlighter { } } - return $extract; } diff --git a/includes/search/SearchMySQL.php b/includes/search/SearchMySQL.php index f834085fc0..485088cb4c 100644 --- a/includes/search/SearchMySQL.php +++ b/includes/search/SearchMySQL.php @@ -382,7 +382,6 @@ class SearchMySQL extends SearchDatabase { function normalizeText( $string ) { global $wgContLang; - $out = parent::normalizeText( $string ); // MySQL fulltext index doesn't grok utf-8, so we @@ -415,7 +414,6 @@ class SearchMySQL extends SearchDatabase { "$1u82e$2", $out ); - return $out; } diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php index 9296aa5289..999dda87ee 100644 --- a/includes/skins/Skin.php +++ b/includes/skins/Skin.php @@ -1468,7 +1468,6 @@ abstract class Skin extends ContextSource { private function getCachedNotice( $name ) { global $wgRenderHashAppend, $parserMemc, $wgContLang; - $needParse = false; if ( $name === 'default' ) { diff --git a/includes/skins/SkinTemplate.php b/includes/skins/SkinTemplate.php index f60e4e8ad4..45a1a8ba8e 100644 --- a/includes/skins/SkinTemplate.php +++ b/includes/skins/SkinTemplate.php @@ -204,8 +204,6 @@ class SkinTemplate extends Skin { $this->userpageUrlDetails = self::makeKnownUrlDetails( $this->userpage ); } - - return $tpl; } @@ -253,7 +251,6 @@ class SkinTemplate extends Skin { $wgShowCreditsIfMax, $wgArticlePath, $wgScriptPath, $wgServer; - $title = $this->getTitle(); $request = $this->getRequest(); $out = $this->getOutput(); @@ -353,7 +350,6 @@ class SkinTemplate extends Skin { $tpl->set( 'userlangattributes', $attrs ); } - $tpl->set( 'newtalk', $this->getNewtalks() ); $tpl->set( 'logo', $this->logoText() ); @@ -798,7 +794,6 @@ class SkinTemplate extends Skin { protected function buildContentNavigationUrls() { global $wgDisableLangConversion; - // Display tabs for the relevant title rather than always the title itself $title = $this->getRelevantTitle(); $onPage = $title->equals( $this->getTitle() ); @@ -884,7 +879,6 @@ class SkinTemplate extends Skin { ); } - // Checks if user can edit the current page if it exists or create it otherwise if ( $title->quickUserCan( 'edit', $user ) && ( $title->exists() || $title->quickUserCan( 'create', $user ) ) @@ -1002,7 +996,6 @@ class SkinTemplate extends Skin { ); } - // Checks if the user is logged in if ( $this->loggedin && $user->isAllowedAll( 'viewmywatchlist', 'editmywatchlist' ) ) { /** @@ -1109,7 +1102,6 @@ class SkinTemplate extends Skin { } } - return $content_navigation; } @@ -1120,7 +1112,6 @@ class SkinTemplate extends Skin { */ private function buildContentActionUrls( $content_navigation ) { - // content_actions has been replaced with content_navigation for backwards // compatibility and also for skins that just want simple tabs content_actions // is now built by flattening the content_navigation arrays into one @@ -1152,7 +1143,6 @@ class SkinTemplate extends Skin { } } - return $content_actions; } @@ -1163,7 +1153,6 @@ class SkinTemplate extends Skin { protected function buildNavUrls() { global $wgUploadNavigationUrl; - $out = $this->getOutput(); $request = $this->getRequest(); diff --git a/includes/specials/SpecialAllMessages.php b/includes/specials/SpecialAllMessages.php index 8af02890bf..7cf94cccc4 100644 --- a/includes/specials/SpecialAllMessages.php +++ b/includes/specials/SpecialAllMessages.php @@ -233,7 +233,6 @@ class AllMessagesTablePager extends TablePager { // Normalise message names so they look like page titles $messageNames = array_map( array( $this->lang, 'ucfirst' ), $messageNames ); - return $messageNames; } @@ -285,7 +284,6 @@ class AllMessagesTablePager extends TablePager { } } - return array( 'pages' => $pageFlags, 'talks' => $talkFlags ); } diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index da2dc7ca09..c96fd14ba9 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -1117,7 +1117,6 @@ class ContribsPager extends ReverseChronologicalPager { $ret = Html::rawElement( 'li', array( 'class' => $classes ), $ret ) . "\n"; } - return $ret; } diff --git a/includes/specials/SpecialDeletedContributions.php b/includes/specials/SpecialDeletedContributions.php index 659a413a6e..680aa35933 100644 --- a/includes/specials/SpecialDeletedContributions.php +++ b/includes/specials/SpecialDeletedContributions.php @@ -257,7 +257,6 @@ class DeletedContribsPager extends IndexPager { $ret = Html::rawElement( 'li', array(), $ret ) . "\n"; - return $ret; } diff --git a/includes/specials/SpecialListusers.php b/includes/specials/SpecialListusers.php index 75015bbbba..56c4eb506f 100644 --- a/includes/specials/SpecialListusers.php +++ b/includes/specials/SpecialListusers.php @@ -246,7 +246,7 @@ class UsersPager extends AlphabeticPager { $this->userGroupCache = $cache; // Add page of groups to link batch - foreach( $groups as $group => $unused ) { + foreach ( $groups as $group => $unused ) { $groupPage = User::getGroupPage( $group ); if ( $groupPage ) { $batch->addObj( $groupPage ); diff --git a/includes/specials/SpecialMergeHistory.php b/includes/specials/SpecialMergeHistory.php index a4e2af94f0..7e74cd5b11 100644 --- a/includes/specials/SpecialMergeHistory.php +++ b/includes/specials/SpecialMergeHistory.php @@ -543,7 +543,6 @@ class MergeHistoryPager extends ReverseChronologicalPager { $batch->execute(); $this->mResult->seek( 0 ); - return ''; } diff --git a/includes/specials/SpecialProtectedtitles.php b/includes/specials/SpecialProtectedtitles.php index 23c1dd6bc2..d25c2c837d 100644 --- a/includes/specials/SpecialProtectedtitles.php +++ b/includes/specials/SpecialProtectedtitles.php @@ -117,7 +117,6 @@ class SpecialProtectedtitles extends SpecialPage { )->escaped(); } - // @todo i18n: This should use a comma separator instead of a hard coded comma, right? return '
  • ' . $lang->specialList( $link, implode( $description_items, ', ' ) ) . "
  • \n"; } diff --git a/includes/specials/SpecialVersion.php b/includes/specials/SpecialVersion.php index 147363d7ef..2aa629e800 100644 --- a/includes/specials/SpecialVersion.php +++ b/includes/specials/SpecialVersion.php @@ -275,7 +275,6 @@ class SpecialVersion extends SpecialPage { )->text(); } - return $version; } @@ -302,7 +301,6 @@ class SpecialVersion extends SpecialPage { } } - return $v; } diff --git a/includes/upload/UploadBase.php b/includes/upload/UploadBase.php index 795afc6cb1..a8a38c70cb 100644 --- a/includes/upload/UploadBase.php +++ b/includes/upload/UploadBase.php @@ -335,7 +335,6 @@ abstract class UploadBase { return array( 'status' => self::HOOK_ABORTED, 'error' => $error ); } - return array( 'status' => self::OK ); } @@ -401,7 +400,6 @@ abstract class UploadBase { } } - return true; } @@ -528,7 +526,6 @@ abstract class UploadBase { return array( 'uploadvirus', $virus ); } - return true; } @@ -689,7 +686,6 @@ abstract class UploadBase { } } - return $warnings; } @@ -729,7 +725,6 @@ abstract class UploadBase { $this->postProcessUpload(); } - return $status; } @@ -925,7 +920,6 @@ abstract class UploadBase { $file = $stash->stashFile( $this->mTempPath, $this->getSourceType() ); $this->mLocalFile = $file; - return $file; } @@ -1691,7 +1685,6 @@ abstract class UploadBase { wfDebug( __METHOD__ . ": FOUND VIRUS! scanner feedback: $output \n" ); } - return $output; } diff --git a/includes/utils/MWCryptRand.php b/includes/utils/MWCryptRand.php index 15047c7110..e6c0e78417 100644 --- a/includes/utils/MWCryptRand.php +++ b/includes/utils/MWCryptRand.php @@ -422,7 +422,6 @@ class MWCryptRand { wfDebug( __METHOD__ . ": " . strlen( $buffer ) . " bytes of randomness leftover in the buffer.\n" ); - return $generated; } -- 2.20.1