From c54766586acab549f186e81eeab259845112809d Mon Sep 17 00:00:00 2001 From: Vivek Ghaisas Date: Fri, 11 Sep 2015 19:14:59 +0530 Subject: [PATCH] Fix issues identified by SpaceBeforeSingleLineComment sniff Change-Id: I048ccb1fa260e4b7152ca5f09b053defdd72d8f9 --- includes/DefaultSettings.php | 38 ++++---- includes/Defines.php | 10 +- includes/EditPage.php | 14 +-- includes/FeedUtils.php | 14 +-- includes/GlobalFunctions.php | 2 +- includes/HttpFunctions.php | 4 +- includes/Import.php | 8 +- includes/LinkFilter.php | 2 +- includes/MWTimestamp.php | 2 +- includes/MimeMagic.php | 4 +- includes/Preferences.php | 26 +++--- includes/Revision.php | 8 +- includes/Sanitizer.php | 10 +- includes/Title.php | 4 +- includes/User.php | 22 ++--- includes/Xml.php | 8 +- includes/actions/RollbackAction.php | 4 +- includes/api/ApiBase.php | 4 +- includes/api/ApiFeedContributions.php | 4 +- includes/api/ApiFormatBase.php | 2 +- includes/api/ApiMain.php | 2 +- includes/api/ApiMove.php | 2 +- includes/api/ApiParse.php | 2 +- includes/api/ApiQueryAllPages.php | 4 +- includes/api/ApiQueryDuplicateFiles.php | 8 +- includes/api/ApiQueryImageInfo.php | 2 +- includes/api/ApiQueryLangLinks.php | 2 +- includes/api/ApiQueryRevisionsBase.php | 2 +- includes/changes/RecentChange.php | 4 +- includes/compat/normal/UtfNormalDefines.php | 2 +- includes/content/AbstractContent.php | 2 +- includes/content/ContentHandler.php | 2 +- includes/content/MessageContent.php | 2 +- includes/db/CloneDatabase.php | 2 +- includes/db/Database.php | 8 +- includes/db/DatabaseOracle.php | 4 +- includes/db/DatabasePostgres.php | 10 +- includes/db/loadbalancer/LoadBalancer.php | 2 +- includes/deferred/DataUpdate.php | 6 +- includes/deferred/SqlDataUpdate.php | 2 +- includes/filerepo/LocalRepo.php | 8 +- includes/filerepo/RepoGroup.php | 2 +- includes/filerepo/file/File.php | 12 +-- includes/installer/Installer.php | 2 +- includes/installer/PostgresUpdater.php | 4 +- includes/jobqueue/jobs/RefreshLinksJob.php | 6 +- includes/libs/SamplingStatsdClient.php | 2 +- includes/logging/BlockLogFormatter.php | 2 +- includes/logging/NewUsersLogFormatter.php | 2 +- includes/media/DjVuImage.php | 6 +- includes/media/Exif.php | 30 +++--- includes/media/ExifBitmap.php | 2 +- includes/media/FormatMetadata.php | 12 +-- includes/media/GIFMetadataExtractor.php | 6 +- includes/media/IPTC.php | 92 +++++++++---------- includes/media/ImageHandler.php | 2 +- includes/media/MediaHandler.php | 2 +- includes/media/XMP.php | 4 +- includes/media/XMPInfo.php | 4 +- includes/media/XMPValidate.php | 10 +- includes/page/Article.php | 10 +- includes/page/WikiPage.php | 4 +- includes/parser/CoreParserFunctions.php | 6 +- includes/parser/LinkHolderArray.php | 4 +- includes/parser/Preprocessor_DOM.php | 6 +- includes/parser/Preprocessor_Hash.php | 4 +- includes/registration/ExtensionProcessor.php | 2 +- includes/search/SearchPostgres.php | 30 +++--- includes/site/SiteExporter.php | 4 +- includes/site/SiteImporter.php | 4 +- includes/site/SiteList.php | 2 +- includes/specialpage/SpecialPageFactory.php | 2 +- includes/specials/SpecialBooksources.php | 2 +- includes/specials/SpecialCategories.php | 12 +-- includes/specials/SpecialEditWatchlist.php | 2 +- includes/specials/SpecialExport.php | 2 +- includes/specials/SpecialListgrouprights.php | 2 +- includes/specials/SpecialListusers.php | 2 +- includes/specials/SpecialMovepage.php | 2 +- includes/specials/SpecialNewpages.php | 2 +- includes/specials/SpecialPrefixindex.php | 4 +- includes/specials/SpecialSearch.php | 6 +- includes/specials/SpecialUndelete.php | 2 +- includes/specials/SpecialWantedpages.php | 4 +- includes/tidy/RaggettExternal.php | 2 +- includes/title/MediaWikiPageLinkRenderer.php | 4 +- includes/title/MediaWikiTitleCodec.php | 4 +- includes/upload/UploadBase.php | 8 +- includes/upload/UploadFromStash.php | 2 +- languages/LanguageConverter.php | 10 +- languages/classes/LanguageTyv.php | 8 +- maintenance/Maintenance.php | 2 +- maintenance/backupPrefetch.inc | 2 +- maintenance/convertLinks.php | 2 +- maintenance/preprocessorFuzzTest.php | 2 +- maintenance/rebuildImages.php | 2 +- maintenance/storage/compressOld.php | 8 +- tests/parser/parserTest.inc | 2 +- tests/phpunit/MediaWikiTestCase.php | 4 +- tests/phpunit/includes/EditPageTest.php | 28 +++--- tests/phpunit/includes/FallbackTest.php | 18 ++-- .../includes/GlobalFunctions/GlobalTest.php | 4 +- .../GlobalFunctions/wfUrlencodeTest.php | 10 +- tests/phpunit/includes/HtmlTest.php | 14 +-- tests/phpunit/includes/HttpTest.php | 4 +- tests/phpunit/includes/LinkFilterTest.php | 2 +- tests/phpunit/includes/LinkerTest.php | 4 +- tests/phpunit/includes/MWNamespaceTest.php | 10 +- .../phpunit/includes/RevisionStorageTest.php | 12 +-- tests/phpunit/includes/RevisionTest.php | 10 +- tests/phpunit/includes/StatusTest.php | 16 ++-- .../includes/TitleArrayFromResultTest.php | 6 +- .../phpunit/includes/TitlePermissionTest.php | 2 +- tests/phpunit/includes/TitleTest.php | 6 +- .../includes/UserArrayFromResultTest.php | 6 +- .../phpunit/includes/api/ApiEditPageTest.php | 12 +-- tests/phpunit/includes/api/ApiWatchTest.php | 2 +- .../api/query/ApiQueryContinueTestBase.php | 2 +- .../includes/cache/GenderCacheTest.php | 10 +- .../includes/content/TextContentTest.php | 6 +- .../includes/content/WikitextContentTest.php | 2 +- .../includes/db/DatabaseSqliteTest.php | 2 +- .../includes/deferred/LinksUpdateTest.php | 2 +- .../includes/filebackend/FileBackendTest.php | 4 +- tests/phpunit/includes/media/DjVuTest.php | 2 +- tests/phpunit/includes/media/PNGTest.php | 2 +- tests/phpunit/includes/page/WikiPageTest.php | 18 ++-- .../includes/parser/MagicVariableTest.php | 6 +- .../phpunit/includes/parser/NewParserTest.php | 22 ++--- .../password/UserPasswordPolicyTest.php | 24 ++--- .../includes/site/MediaWikiSiteTest.php | 2 +- tests/phpunit/includes/site/SiteTest.php | 10 +- tests/phpunit/includes/site/TestSites.php | 2 +- .../specials/SpecialRecentchangesTest.php | 2 +- .../title/MediaWikiPageLinkRendererTest.php | 8 +- .../title/MediaWikiTitleCodecTest.php | 16 ++-- .../languages/classes/LanguageSrTest.php | 26 +++--- .../languages/classes/LanguageUzTest.php | 2 +- tests/phpunit/phpunit.php | 2 +- thumb.php | 2 +- 140 files changed, 496 insertions(+), 496 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index f58b339bb4..802229e64c 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -867,12 +867,12 @@ $wgUploadSizeWarning = false; * [[media:...]] links for non-trusted formats. */ $wgTrustedMediaFormats = array( - MEDIATYPE_BITMAP, //all bitmap formats - MEDIATYPE_AUDIO, //all audio formats - MEDIATYPE_VIDEO, //all plain video formats - "image/svg+xml", //svg (only needed if inline rendering of svg is not supported) - "application/pdf", //PDF files - #"application/x-shockwave-flash", //flash/shockwave movie + MEDIATYPE_BITMAP, // all bitmap formats + MEDIATYPE_AUDIO, // all audio formats + MEDIATYPE_VIDEO, // all plain video formats + "image/svg+xml", // svg (only needed if inline rendering of svg is not supported) + "application/pdf", // PDF files + # "application/x-shockwave-flash", //flash/shockwave movie ); /** @@ -1173,7 +1173,7 @@ $wgAntivirus = null; */ $wgAntivirusSetup = array( - #setup for clamav + # setup for clamav 'clamav' => array( 'command' => 'clamscan --no-summary ', 'codemap' => array( @@ -4003,7 +4003,7 @@ $wgInvalidRedirectTargets = array( 'Filepath', 'Mypage', 'Mytalk', 'Redirect' ); */ $wgParserConf = array( 'class' => 'Parser', - #'preprocessorClass' => 'Preprocessor_Hash', + # 'preprocessorClass' => 'Preprocessor_Hash', ); /** @@ -4702,7 +4702,7 @@ $wgGroupPermissions['*']['editmywatchlist'] = true; $wgGroupPermissions['*']['viewmyprivateinfo'] = true; $wgGroupPermissions['*']['editmyprivateinfo'] = true; $wgGroupPermissions['*']['editmyoptions'] = true; -#$wgGroupPermissions['*']['patrolmarks'] = false; // let anons see what was patrolled +# $wgGroupPermissions['*']['patrolmarks'] = false; // let anons see what was patrolled // Implicit group for all logged-in accounts $wgGroupPermissions['user']['move'] = true; @@ -4780,8 +4780,8 @@ $wgGroupPermissions['sysop']['noratelimit'] = true; $wgGroupPermissions['sysop']['movefile'] = true; $wgGroupPermissions['sysop']['unblockself'] = true; $wgGroupPermissions['sysop']['suppressredirect'] = true; -#$wgGroupPermissions['sysop']['pagelang'] = true; -#$wgGroupPermissions['sysop']['upload_by_url'] = true; +# $wgGroupPermissions['sysop']['pagelang'] = true; +# $wgGroupPermissions['sysop']['upload_by_url'] = true; $wgGroupPermissions['sysop']['mergehistory'] = true; $wgGroupPermissions['sysop']['managechangetags'] = true; @@ -4789,20 +4789,20 @@ $wgGroupPermissions['sysop']['managechangetags'] = true; $wgGroupPermissions['bureaucrat']['userrights'] = true; $wgGroupPermissions['bureaucrat']['noratelimit'] = true; // Permission to change users' groups assignments across wikis -#$wgGroupPermissions['bureaucrat']['userrights-interwiki'] = true; +# $wgGroupPermissions['bureaucrat']['userrights-interwiki'] = true; // Permission to export pages including linked pages regardless of $wgExportMaxLinkDepth -#$wgGroupPermissions['bureaucrat']['override-export-depth'] = true; +# $wgGroupPermissions['bureaucrat']['override-export-depth'] = true; -#$wgGroupPermissions['sysop']['deletelogentry'] = true; -#$wgGroupPermissions['sysop']['deleterevision'] = true; +# $wgGroupPermissions['sysop']['deletelogentry'] = true; +# $wgGroupPermissions['sysop']['deleterevision'] = true; // To hide usernames from users and Sysops -#$wgGroupPermissions['suppress']['hideuser'] = true; +# $wgGroupPermissions['suppress']['hideuser'] = true; // To hide revisions/log items from users and Sysops -#$wgGroupPermissions['suppress']['suppressrevision'] = true; +# $wgGroupPermissions['suppress']['suppressrevision'] = true; // To view revisions/log items hidden from users and Sysops -#$wgGroupPermissions['suppress']['viewsuppressed'] = true; +# $wgGroupPermissions['suppress']['viewsuppressed'] = true; // For private suppression log access -#$wgGroupPermissions['suppress']['suppressionlog'] = true; +# $wgGroupPermissions['suppress']['suppressionlog'] = true; /** * The developer group is deprecated, but can be activated if need be diff --git a/includes/Defines.php b/includes/Defines.php index d55bbcf819..1c06ad0d78 100644 --- a/includes/Defines.php +++ b/includes/Defines.php @@ -33,7 +33,7 @@ define( 'DBO_IGNORE', 4 ); define( 'DBO_TRX', 8 ); // automatically start transaction on first query define( 'DBO_DEFAULT', 16 ); define( 'DBO_PERSISTENT', 32 ); -define( 'DBO_SYSDBA', 64 ); //for oracle maintenance +define( 'DBO_SYSDBA', 64 ); // for oracle maintenance define( 'DBO_DDLMODE', 128 ); // when using schema files: mostly for Oracle define( 'DBO_SSL', 256 ); define( 'DBO_COMPRESS', 512 ); @@ -135,10 +135,10 @@ define( 'MEDIATYPE_ARCHIVE', 'ARCHIVE' ); /**@{ * Antivirus result codes, for use in $wgAntivirusSetup. */ -define( 'AV_NO_VIRUS', 0 ); #scan ok, no virus found -define( 'AV_VIRUS_FOUND', 1 ); #virus found! -define( 'AV_SCAN_ABORTED', -1 ); #scan aborted, the file is probably immune -define( 'AV_SCAN_FAILED', false ); #scan failed (scanner not found or error in scanner) +define( 'AV_NO_VIRUS', 0 ); # scan ok, no virus found +define( 'AV_VIRUS_FOUND', 1 ); # virus found! +define( 'AV_SCAN_ABORTED', -1 ); # scan aborted, the file is probably immune +define( 'AV_SCAN_FAILED', false ); # scan failed (scanner not found or error in scanner) /**@}*/ /**@{ diff --git a/includes/EditPage.php b/includes/EditPage.php index 89b484cc8d..9059987595 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -980,7 +980,7 @@ class EditPage { global $wgUser; $this->edittime = $this->mArticle->getTimestamp(); - $content = $this->getContentObject( false ); #TODO: track content object?! + $content = $this->getContentObject( false ); # TODO: track content object?! if ( $content === false ) { return false; } @@ -1228,7 +1228,7 @@ class EditPage { $title = Title::newFromText( $preload ); # Check for existence to avoid getting MediaWiki:Noarticletext if ( $title === null || !$title->exists() || !$title->userCan( 'read', $wgUser ) ) { - //TODO: somehow show a warning to the user! + // TODO: somehow show a warning to the user! return $handler->makeEmptyContent(); } @@ -1237,7 +1237,7 @@ class EditPage { $title = $page->getRedirectTarget(); # Same as before if ( $title === null || !$title->exists() || !$title->userCan( 'read', $wgUser ) ) { - //TODO: somehow show a warning to the user! + // TODO: somehow show a warning to the user! return $handler->makeEmptyContent(); } $page = WikiPage::factory( $title ); @@ -1247,7 +1247,7 @@ class EditPage { $content = $page->getContent( Revision::RAW ); if ( !$content ) { - //TODO: somehow show a warning to the user! + // TODO: somehow show a warning to the user! return $handler->makeEmptyContent(); } @@ -1255,7 +1255,7 @@ class EditPage { $converted = $content->convert( $handler->getModelID() ); if ( !$converted ) { - //TODO: somehow show a warning to the user! + // TODO: somehow show a warning to the user! wfDebug( "Attempt to preload incompatible content: " . "can't convert " . $content->getModel() . " to " . $handler->getModelID() ); @@ -2514,7 +2514,7 @@ class EditPage { # user preference is active, pass a hidden tag as wpIgnoreBlankSummary. This will stop the # user being bounced back more than once in the event that a summary # is not required. - ##### + # #### # For a bit more sophisticated detection of blank summaries, hash the # automatic one and pass that in the hidden field wpAutoSummary. if ( $this->missingSummary || ( $this->section == 'new' && $this->nosummary ) ) { @@ -2681,7 +2681,7 @@ class EditPage { if ( $this->section != '' && $this->section != 'new' ) { if ( !$this->summary && !$this->preview && !$this->diff ) { - $sectionTitle = self::extractSectionTitle( $this->textbox1 ); //FIXME: use Content object + $sectionTitle = self::extractSectionTitle( $this->textbox1 ); // FIXME: use Content object if ( $sectionTitle !== false ) { $this->summary = "/* $sectionTitle */ "; } diff --git a/includes/FeedUtils.php b/includes/FeedUtils.php index a01d64208c..57ba4b3e08 100644 --- a/includes/FeedUtils.php +++ b/includes/FeedUtils.php @@ -128,11 +128,11 @@ class FeedUtils { if ( $oldid ) { - #$diffText = $de->getDiff( wfMessage( 'revisionasof', - # $wgLang->timeanddate( $timestamp ), - # $wgLang->date( $timestamp ), - # $wgLang->time( $timestamp ) )->text(), - # wfMessage( 'currentrev' )->text() ); + # $diffText = $de->getDiff( wfMessage( 'revisionasof', + # $wgLang->timeanddate( $timestamp ), + # $wgLang->date( $timestamp ), + # $wgLang->time( $timestamp ) )->text(), + # wfMessage( 'currentrev' )->text() ); $diffText = ''; // Don't bother generating the diff if we won't be able to show it @@ -185,10 +185,10 @@ class FeedUtils { $html = nl2br( htmlspecialchars( $text ) ); } } else { - //XXX: we could get an HTML representation of the content via getParserOutput, but that may + // XXX: we could get an HTML representation of the content via getParserOutput, but that may // contain JS magic and generally may not be suitable for inclusion in a feed. // Perhaps Content should have a getDescriptiveHtml method and/or a getSourceText method. - //Compare also ApiFeedContributions::feedItemDesc + // Compare also ApiFeedContributions::feedItemDesc $html = null; } diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 8f70120833..c524948402 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -2542,7 +2542,7 @@ function wfMkdirParents( $dir, $mode = null, $caller = null ) { MediaWiki\restoreWarnings(); if ( !$ok ) { - //directory may have been created on another request since we last checked + // directory may have been created on another request since we last checked if ( is_dir( $dir ) ) { return true; } diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php index ad5aeb3edc..578b53580d 100644 --- a/includes/HttpFunctions.php +++ b/includes/HttpFunctions.php @@ -678,7 +678,7 @@ class MWHttpRequest { public function getFinalUrl() { $headers = $this->getResponseHeaders(); - //return full url (fix for incorrect but handled relative location) + // return full url (fix for incorrect but handled relative location) if ( isset( $headers['location'] ) ) { $locations = $headers['location']; $domain = ''; @@ -690,7 +690,7 @@ class MWHttpRequest { if ( isset( $url['host'] ) ) { $domain = $url['scheme'] . '://' . $url['host']; - break; //found correct URI (with host) + break; // found correct URI (with host) } else { $foundRelativeURI = true; } diff --git a/includes/Import.php b/includes/Import.php index db4a6b2d2a..60d4a1f842 100644 --- a/includes/Import.php +++ b/includes/Import.php @@ -265,7 +265,7 @@ class WikiImporter { // No rootpage $this->setImportTitleFactory( new NaiveImportTitleFactory() ); } elseif ( $rootpage !== '' ) { - $rootpage = rtrim( $rootpage, '/' ); //avoid double slashes + $rootpage = rtrim( $rootpage, '/' ); // avoid double slashes $title = Title::newFromText( $rootpage ); if ( !$title || $title->isExternal() ) { @@ -1613,7 +1613,7 @@ class WikiRevision { 'page' => $pageId, 'content_model' => $this->getModel(), 'content_format' => $this->getFormat(), - //XXX: just set 'content' => $this->getContent()? + // XXX: just set 'content' => $this->getContent()? 'text' => $this->getContent()->serialize( $this->getFormat() ), 'comment' => $this->getComment(), 'user' => $userId, @@ -1654,7 +1654,7 @@ class WikiRevision { 'log_namespace' => $this->getTitle()->getNamespace(), 'log_title' => $this->getTitle()->getDBkey(), 'log_comment' => $this->getComment(), - #'log_user_text' => $this->user_text, + # 'log_user_text' => $this->user_text, 'log_params' => $this->params ), __METHOD__ ); @@ -1672,7 +1672,7 @@ class WikiRevision { 'log_action' => $this->action, 'log_timestamp' => $dbw->timestamp( $this->timestamp ), 'log_user' => User::idFromName( $this->user_text ), - #'log_user_text' => $this->user_text, + # 'log_user_text' => $this->user_text, 'log_namespace' => $this->getTitle()->getNamespace(), 'log_title' => $this->getTitle()->getDBkey(), 'log_comment' => $this->getComment(), diff --git a/includes/LinkFilter.php b/includes/LinkFilter.php index 99aaaa093a..7215cec922 100644 --- a/includes/LinkFilter.php +++ b/includes/LinkFilter.php @@ -41,7 +41,7 @@ class LinkFilter { */ static function matchEntry( Content $content, $filterEntry ) { if ( !( $content instanceof TextContent ) ) { - //TODO: handle other types of content too. + // TODO: handle other types of content too. // Maybe create ContentHandler::matchFilter( LinkFilter ). // Think about a common base class for LinkFilter and MagicWord. return 0; diff --git a/includes/MWTimestamp.php b/includes/MWTimestamp.php index 6f3be73f4d..102be80182 100644 --- a/includes/MWTimestamp.php +++ b/includes/MWTimestamp.php @@ -106,7 +106,7 @@ class MWTimestamp { $ts, $da ) ) { - #TS_ISO_8601_BASIC + # TS_ISO_8601_BASIC } elseif ( preg_match( '/^(\d{4})\-(\d\d)\-(\d\d) (\d\d):(\d\d):(\d\d)\.*\d*[\+\- ](\d\d)$/', $ts, diff --git a/includes/MimeMagic.php b/includes/MimeMagic.php index 2b240c3b02..8ab92b4c1e 100644 --- a/includes/MimeMagic.php +++ b/includes/MimeMagic.php @@ -323,7 +323,7 @@ class MimeMagic { continue; } - #print "processing MIME INFO line $s
"; + # print "processing MIME INFO line $s
"; $match = array(); if ( preg_match( '!\[\s*(\w+)\s*\]!', $s, $match ) ) { @@ -957,7 +957,7 @@ class MimeMagic { if ( $m ) { # normalize - $m = preg_replace( '![;, ].*$!', '', $m ); #strip charset, etc + $m = preg_replace( '![;, ].*$!', '', $m ); # strip charset, etc $m = trim( $m ); $m = strtolower( $m ); diff --git a/includes/Preferences.php b/includes/Preferences.php index d0475c176b..b3ee207f46 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -112,20 +112,20 @@ class Preferences { * @return array|null */ static function loadPreferenceValues( $user, $context, &$defaultPreferences ) { - ## Remove preferences that wikis don't want to use + # # Remove preferences that wikis don't want to use foreach ( $context->getConfig()->get( 'HiddenPrefs' ) as $pref ) { if ( isset( $defaultPreferences[$pref] ) ) { unset( $defaultPreferences[$pref] ); } } - ## Make sure that form fields have their parent set. See bug 41337. + # # Make sure that form fields have their parent set. See bug 41337. $dummyForm = new HTMLForm( array(), $context ); $disable = !$user->isAllowed( 'editmyoptions' ); $defaultOptions = User::getDefaultOptions(); - ## Prod in defaults from the user + # # Prod in defaults from the user foreach ( $defaultPreferences as $name => &$info ) { $prefFromUser = self::getOptionFromUser( $name, $info, $user ); if ( $disable && !in_array( $name, self::$saveBlacklist ) ) { @@ -211,7 +211,7 @@ class Preferences { // retrieving user name for GENDER and misc. $userName = $user->getName(); - ## User info ##################################### + # # User info ##################################### // Information panel $defaultPreferences['username'] = array( 'type' => 'info', @@ -427,7 +427,7 @@ class Preferences { 'section' => 'personal/signature' ); - ## Email stuff + # # Email stuff if ( $config->get( 'EnableEmail' ) ) { if ( $canViewPrivateInfo ) { @@ -571,7 +571,7 @@ class Preferences { * @return void */ static function skinPreferences( $user, IContextSource $context, &$defaultPreferences ) { - ## Skin ##################################### + # # Skin ##################################### // Skin selector, if there is at least one valid skin $skinOptions = self::generateSkinOptions( $user, $context ); @@ -620,7 +620,7 @@ class Preferences { * @param array $defaultPreferences */ static function filesPreferences( $user, IContextSource $context, &$defaultPreferences ) { - ## Files ##################################### + # # Files ##################################### $defaultPreferences['imagesize'] = array( 'type' => 'select', 'options' => self::getImageSizes( $context ), @@ -642,7 +642,7 @@ class Preferences { * @return void */ static function datetimePreferences( $user, IContextSource $context, &$defaultPreferences ) { - ## Date and time ##################################### + # # Date and time ##################################### $dateOptions = self::getDateOptions( $context ); if ( $dateOptions ) { $defaultPreferences['date'] = array( @@ -715,7 +715,7 @@ class Preferences { * @param array $defaultPreferences */ static function renderingPreferences( $user, IContextSource $context, &$defaultPreferences ) { - ## Diffs #################################### + # # Diffs #################################### $defaultPreferences['diffonly'] = array( 'type' => 'toggle', 'section' => 'rendering/diffs', @@ -727,7 +727,7 @@ class Preferences { 'label-message' => 'tog-norollbackdiff', ); - ## Page Rendering ############################## + # # Page Rendering ############################## if ( $context->getConfig()->get( 'AllowUserCssPrefs' ) ) { $defaultPreferences['underline'] = array( 'type' => 'select', @@ -777,7 +777,7 @@ class Preferences { * @param array $defaultPreferences */ static function editingPreferences( $user, IContextSource $context, &$defaultPreferences ) { - ## Editing ##################################### + # # Editing ##################################### $defaultPreferences['editsectiononrightclick'] = array( 'type' => 'toggle', 'section' => 'editing/advancedediting', @@ -865,7 +865,7 @@ class Preferences { static function rcPreferences( $user, IContextSource $context, &$defaultPreferences ) { $config = $context->getConfig(); $rcMaxAge = $config->get( 'RCMaxAge' ); - ## RecentChanges ##################################### + # # RecentChanges ##################################### $defaultPreferences['rcdays'] = array( 'type' => 'float', 'label-message' => 'recentchangesdays', @@ -926,7 +926,7 @@ class Preferences { $config = $context->getConfig(); $watchlistdaysMax = ceil( $config->get( 'RCMaxAge' ) / ( 3600 * 24 ) ); - ## Watchlist ##################################### + # # Watchlist ##################################### if ( $user->isAllowed( 'editmywatchlist' ) ) { $editWatchlistLinks = array(); $editWatchlistModes = array( diff --git a/includes/Revision.php b/includes/Revision.php index 32ee259f3d..658420702a 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -773,7 +773,7 @@ class Revision implements IDBAccessObject { if ( $this->mTitle !== null ) { return $this->mTitle; } - //rev_id is defined as NOT NULL, but this revision may not yet have been inserted. + // rev_id is defined as NOT NULL, but this revision may not yet have been inserted. if ( $this->mId !== null ) { $dbr = wfGetDB( DB_SLAVE ); $row = $dbr->selectRow( @@ -1418,8 +1418,8 @@ class Revision implements IDBAccessObject { ); if ( $wgContentHandlerUseDB ) { - //NOTE: Store null for the default model and format, to save space. - //XXX: Makes the DB sensitive to changed defaults. + // NOTE: Store null for the default model and format, to save space. + // XXX: Makes the DB sensitive to changed defaults. // Make this behavior optional? Only in miser mode? $model = $this->getContentModel(); @@ -1459,7 +1459,7 @@ class Revision implements IDBAccessObject { protected function checkContentModel() { global $wgContentHandlerUseDB; - $title = $this->getTitle(); //note: may return null for revisions that have not yet been inserted. + $title = $this->getTitle(); // note: may return null for revisions that have not yet been inserted. $model = $this->getContentModel(); $format = $this->getContentFormat(); diff --git a/includes/Sanitizer.php b/includes/Sanitizer.php index 3e07b045c4..f88dd057e7 100644 --- a/includes/Sanitizer.php +++ b/includes/Sanitizer.php @@ -536,7 +536,7 @@ class Sanitizer { $badtag = true; } elseif ( in_array( $t, $tagstack ) && !isset( $htmlnest[$t] ) ) { $badtag = true; - # Is it a self closed htmlpair ? (bug 5487) + #  Is it a self closed htmlpair ? (bug 5487) } elseif ( $brace == '/>' && isset( $htmlpairs[$t] ) ) { $badtag = true; } elseif ( isset( $htmlsingleonly[$t] ) ) { @@ -738,7 +738,7 @@ class Sanitizer { $out = array(); foreach ( $attribs as $attribute => $value ) { - #allow XML namespace declaration if RDFa is enabled + # allow XML namespace declaration if RDFa is enabled if ( $wgAllowRdfaAttributes && preg_match( self::XMLNS_ATTRIBUTE_PATTERN, $attribute ) ) { if ( !preg_match( self::EVIL_URI_PATTERN, $value ) ) { $out[$attribute] = $value; @@ -784,7 +784,7 @@ class Sanitizer { || $attribute === 'itemref' || $attribute === 'itemscope' || $attribute === 'itemtype' ) { - //Paranoia. Allow "simple" values but suppress javascript + // Paranoia. Allow "simple" values but suppress javascript if ( preg_match( self::EVIL_URI_PATTERN, $value ) ) { continue; } @@ -794,7 +794,7 @@ class Sanitizer { # validation code that can be used by tag hook handlers, etc if ( $attribute === 'href' || $attribute === 'src' ) { if ( !preg_match( $hrefExp, $value ) ) { - continue; //drop any href or src attributes not using an allowed protocol. + continue; // drop any href or src attributes not using an allowed protocol. // NOTE: this also drops all relative URLs } } @@ -1697,7 +1697,7 @@ class Sanitizer { # rbc 'rb' => $common, 'rp' => $common, - 'rt' => $common, #array_merge( $common, array( 'rbspan' ) ), + 'rt' => $common, # array_merge( $common, array( 'rbspan' ) ), 'rtc' => $common, # MathML root element, where used for extensions diff --git a/includes/Title.php b/includes/Title.php index b347edbb6a..e54c35e604 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -206,7 +206,7 @@ class Title { * @return TitleFormatter */ private static function getTitleFormatter() { - //NOTE: we know that getTitleParser() returns a MediaWikiTitleCodec, + // NOTE: we know that getTitleParser() returns a MediaWikiTitleCodec, // which implements TitleFormatter. return self::getTitleParser(); } @@ -2944,7 +2944,7 @@ class Title { $this->mRestrictions['move'] = explode( ',', trim( $temp[0] ) ); } else { $restriction = trim( $temp[1] ); - if ( $restriction != '' ) { //some old entries are empty + if ( $restriction != '' ) { // some old entries are empty $this->mRestrictions[$temp[0]] = explode( ',', $restriction ); } } diff --git a/includes/User.php b/includes/User.php index 753061d08d..faf1bdc48c 100644 --- a/includes/User.php +++ b/includes/User.php @@ -129,7 +129,7 @@ class User implements IDBAccessObject { 'editmyuserjs', 'editmywatchlist', 'editsemiprotected', - 'editusercssjs', #deprecated + 'editusercssjs', # deprecated 'editusercss', 'edituserjs', 'hideuser', @@ -184,7 +184,7 @@ class User implements IDBAccessObject { protected static $mAllRights = false; /** Cache variables */ - //@{ + // @{ public $mId; /** @var string */ public $mName; @@ -228,19 +228,19 @@ class User implements IDBAccessObject { protected $mOptionOverrides; /** @var string */ protected $mPasswordExpires; - //@} + // @} /** * Bool Whether the cache variables have been loaded. */ - //@{ + // @{ public $mOptionsLoaded; /** * Array with already loaded items or true if all items have been loaded. */ protected $mLoadedItems = array(); - //@} + // @} /** * String Initialization data source if mLoadedItems!==true. May be one of: @@ -462,7 +462,7 @@ class User implements IDBAccessObject { } /** @name newFrom*() static factory methods */ - //@{ + // @{ /** * Static factory method for creation from username. @@ -573,7 +573,7 @@ class User implements IDBAccessObject { return $user; } - //@} + // @} /** * Get the username corresponding to a given user ID @@ -799,7 +799,7 @@ class User implements IDBAccessObject { * @return bool */ public function isValidPassword( $password ) { - //simple boolean wrapper for getPasswordValidity + // simple boolean wrapper for getPasswordValidity return $this->getPasswordValidity( $password ) === true; } @@ -856,7 +856,7 @@ class User implements IDBAccessObject { ); $status = Status::newGood(); - $result = false; //init $result to false for the internal checks + $result = false; // init $result to false for the internal checks if ( !Hooks::run( 'isValidPassword', array( $password, &$result, $this ) ) ) { $status->error( $result ); @@ -870,7 +870,7 @@ class User implements IDBAccessObject { return $status; } else { $status->error( $result ); - return $status; //the isValidPassword hook set a string $result and returned true + return $status; // the isValidPassword hook set a string $result and returned true } } @@ -5209,7 +5209,7 @@ class User implements IDBAccessObject { # is b0rked anyway in some browsers, just return nothing. When it's # re-enabled, fix this code to not output required for e-mail # registration. - #$ret = array( 'required' ); + # $ret = array( 'required' ); $ret = array(); # We can't actually do this right now, because Opera 9.6 will print out diff --git a/includes/Xml.php b/includes/Xml.php index 37cffdefa0..11f14dbb69 100644 --- a/includes/Xml.php +++ b/includes/Xml.php @@ -711,10 +711,10 @@ class Xml { xml_parser_set_option( $parser, XML_OPTION_CASE_FOLDING, false ); if ( !xml_parse( $parser, $text, true ) ) { - //$err = xml_error_string( xml_get_error_code( $parser ) ); - //$position = xml_get_current_byte_index( $parser ); - //$fragment = $this->extractFragment( $html, $position ); - //$this->mXmlError = "$err at byte $position:\n$fragment"; + // $err = xml_error_string( xml_get_error_code( $parser ) ); + // $position = xml_get_current_byte_index( $parser ); + // $fragment = $this->extractFragment( $html, $position ); + // $this->mXmlError = "$err at byte $position:\n$fragment"; xml_parser_free( $parser ); return false; } diff --git a/includes/actions/RollbackAction.php b/includes/actions/RollbackAction.php index 70d7d16163..040485637d 100644 --- a/includes/actions/RollbackAction.php +++ b/includes/actions/RollbackAction.php @@ -78,13 +78,13 @@ class RollbackAction extends FormlessAction { return; } - #NOTE: Permission errors already handled by Action::checkExecute. + # NOTE: Permission errors already handled by Action::checkExecute. if ( $result == array( array( 'readonlytext' ) ) ) { throw new ReadOnlyError; } - #XXX: Would be nice if ErrorPageError could take multiple errors, and/or a status object. + # XXX: Would be nice if ErrorPageError could take multiple errors, and/or a status object. # Right now, we only show the first error foreach ( $result as $error ) { throw new ErrorPageError( 'rollbackfailed', $error[0], array_slice( $error, 1 ) ); diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index 7743384dd0..64dc9a3e71 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -2672,14 +2672,14 @@ abstract class ApiBase extends ContextSource { $desc = implode( $paramPrefix, $desc ); } - //handle shorthand + // handle shorthand if ( !is_array( $paramSettings ) ) { $paramSettings = array( self::PARAM_DFLT => $paramSettings, ); } - //handle missing type + // handle missing type if ( !isset( $paramSettings[ApiBase::PARAM_TYPE] ) ) { $dflt = isset( $paramSettings[ApiBase::PARAM_DFLT] ) ? $paramSettings[ApiBase::PARAM_DFLT] diff --git a/includes/api/ApiFeedContributions.php b/includes/api/ApiFeedContributions.php index edda67231f..2df5f9f3f4 100644 --- a/includes/api/ApiFeedContributions.php +++ b/includes/api/ApiFeedContributions.php @@ -163,10 +163,10 @@ class ApiFeedContributions extends ApiBase { // only textual content has a "source view". $html = nl2br( htmlspecialchars( $content->getNativeData() ) ); } else { - //XXX: we could get an HTML representation of the content via getParserOutput, but that may + // XXX: we could get an HTML representation of the content via getParserOutput, but that may // contain JS magic and generally may not be suitable for inclusion in a feed. // Perhaps Content should have a getDescriptiveHtml method and/or a getSourceText method. - //Compare also FeedUtils::formatDiffRow. + // Compare also FeedUtils::formatDiffRow. $html = ''; } diff --git a/includes/api/ApiFormatBase.php b/includes/api/ApiFormatBase.php index e522d709f1..3c10518f51 100644 --- a/includes/api/ApiFormatBase.php +++ b/includes/api/ApiFormatBase.php @@ -155,7 +155,7 @@ abstract class ApiFormatBase extends ApiBase { $this->getMain()->getRequest()->response()->header( "Content-Type: $mime; charset=utf-8" ); - //Set X-Frame-Options API results (bug 39180) + // Set X-Frame-Options API results (bug 39180) $apiFrameOptions = $this->getConfig()->get( 'ApiFrameOptions' ); if ( $apiFrameOptions ) { $this->getMain()->getRequest()->response()->header( "X-Frame-Options: $apiFrameOptions" ); diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index d943c86b42..95ad3ba67c 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -1236,7 +1236,7 @@ class ApiMain extends ApiBase { $this->reportUnusedParams(); if ( !$this->mInternalMode ) { - //append Debug information + // append Debug information MWDebug::appendDebugInfoToApiResult( $this->getContext(), $this->getResult() ); // Print result data diff --git a/includes/api/ApiMove.php b/includes/api/ApiMove.php index aca4378437..60fd42668a 100644 --- a/includes/api/ApiMove.php +++ b/includes/api/ApiMove.php @@ -85,7 +85,7 @@ class ApiMove extends ApiBase { 'reason' => $params['reason'] ); - //NOTE: we assume that if the old title exists, it's because it was re-created as + // NOTE: we assume that if the old title exists, it's because it was re-created as // a redirect to the new title. This is not safe, but what we did before was // even worse: we just determined whether a redirect should have been created, // and reported that it was created if it should have, without any checks. diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index cce8572344..fcab9be2c3 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -526,7 +526,7 @@ class ApiParse extends ApiBase { * @return Content */ private function getContent( WikiPage $page, $pageId = null ) { - $content = $page->getContent( Revision::RAW ); //XXX: really raw? + $content = $page->getContent( Revision::RAW ); // XXX: really raw? if ( $this->section !== false && $content !== null ) { $content = $this->getSectionContent( diff --git a/includes/api/ApiQueryAllPages.php b/includes/api/ApiQueryAllPages.php index e441991af8..78e3621738 100644 --- a/includes/api/ApiQueryAllPages.php +++ b/includes/api/ApiQueryAllPages.php @@ -200,14 +200,14 @@ class ApiQueryAllPages extends ApiQueryGeneratorBase { $this->addOption( 'LIMIT', $limit + 1 ); $res = $this->select( __METHOD__ ); - //Get gender information + // Get gender information if ( MWNamespace::hasGenderDistinction( $params['namespace'] ) ) { $users = array(); foreach ( $res as $row ) { $users[] = $row->page_title; } GenderCache::singleton()->doQuery( $users, __METHOD__ ); - $res->rewind(); //reset + $res->rewind(); // reset } $count = 0; diff --git a/includes/api/ApiQueryDuplicateFiles.php b/includes/api/ApiQueryDuplicateFiles.php index 3282c71775..1038a9f3bd 100644 --- a/includes/api/ApiQueryDuplicateFiles.php +++ b/includes/api/ApiQueryDuplicateFiles.php @@ -107,7 +107,7 @@ class ApiQueryDuplicateFiles extends ApiQueryGeneratorBase { // iterate over $images to handle continue param correct foreach ( $images as $image => $pageId ) { if ( !isset( $sha1s[$image] ) ) { - continue; //file does not exist + continue; // file does not exist } $sha1 = $sha1s[$image]; $dupFiles = $filesBySha1s[$sha1]; @@ -118,14 +118,14 @@ class ApiQueryDuplicateFiles extends ApiQueryGeneratorBase { foreach ( $dupFiles as $dupFile ) { $dupName = $dupFile->getName(); if ( $image == $dupName && $dupFile->isLocal() ) { - continue; //ignore the local file itself + continue; // ignore the local file itself } if ( $skipUntilThisDup !== false && $dupName < $skipUntilThisDup ) { - continue; //skip to pos after the image from continue param + continue; // skip to pos after the image from continue param } $skipUntilThisDup = false; if ( ++$count > $params['limit'] ) { - $fit = false; //break outer loop + $fit = false; // break outer loop // We're one over limit which shows that // there are additional images to be had. Stop here... $this->setContinueEnumParameter( 'continue', $image . '|' . $dupName ); diff --git a/includes/api/ApiQueryImageInfo.php b/includes/api/ApiQueryImageInfo.php index ba36c67f3a..c7690243c3 100644 --- a/includes/api/ApiQueryImageInfo.php +++ b/includes/api/ApiQueryImageInfo.php @@ -480,7 +480,7 @@ class ApiQueryImageInfo extends ApiQueryBase { } if ( !$canShowField( File::DELETED_FILE ) ) { - //Early return, tidier than indenting all following things one level + // Early return, tidier than indenting all following things one level return $vals; } diff --git a/includes/api/ApiQueryLangLinks.php b/includes/api/ApiQueryLangLinks.php index 25e534e100..899a3829bd 100644 --- a/includes/api/ApiQueryLangLinks.php +++ b/includes/api/ApiQueryLangLinks.php @@ -75,7 +75,7 @@ class ApiQueryLangLinks extends ApiQueryBase { ); } - //FIXME: (follow-up) To allow extensions to add to the language links, we need + // FIXME: (follow-up) To allow extensions to add to the language links, we need // to load them all, add the extra links, then apply paging. // Should not be terrible, it's not going to be more than a few hundred links. diff --git a/includes/api/ApiQueryRevisionsBase.php b/includes/api/ApiQueryRevisionsBase.php index d57dc3ccd9..f8dbf23c2a 100644 --- a/includes/api/ApiQueryRevisionsBase.php +++ b/includes/api/ApiQueryRevisionsBase.php @@ -307,7 +307,7 @@ abstract class ApiQueryRevisionsBase extends ApiQueryGeneratorBase { $text = null; if ( $this->expandTemplates && !$this->parseContent ) { - #XXX: implement template expansion for all content types in ContentHandler? + # XXX: implement template expansion for all content types in ContentHandler? if ( $content->getModel() === CONTENT_MODEL_WIKITEXT ) { $text = $content->getNativeData(); diff --git a/includes/changes/RecentChange.php b/includes/changes/RecentChange.php index 87871f494d..5c884a5e91 100644 --- a/includes/changes/RecentChange.php +++ b/includes/changes/RecentChange.php @@ -293,7 +293,7 @@ class RecentChange { $this->mAttribs['rc_timestamp'] = $dbw->timestamp( $this->mAttribs['rc_timestamp'] ); $this->mAttribs['rc_id'] = $dbw->nextSequenceValue( 'recentchanges_rc_id_seq' ); - ## If we are using foreign keys, an entry of 0 for the page_id will fail, so use NULL + # # If we are using foreign keys, an entry of 0 for the page_id will fail, so use NULL if ( $dbw->cascadingDeletes() && $this->mAttribs['rc_cur_id'] == 0 ) { unset( $this->mAttribs['rc_cur_id'] ); } @@ -688,7 +688,7 @@ class RecentChange { $type, $action, $target, $logComment, $params, $newId = 0, $actionCommentIRC = '' ) { global $wgRequest; - ## Get pageStatus for email notification + # # Get pageStatus for email notification switch ( $type . '-' . $action ) { case 'delete-delete': $pageStatus = 'deleted'; diff --git a/includes/compat/normal/UtfNormalDefines.php b/includes/compat/normal/UtfNormalDefines.php index b8e44c7776..38ce8550a6 100644 --- a/includes/compat/normal/UtfNormalDefines.php +++ b/includes/compat/normal/UtfNormalDefines.php @@ -143,7 +143,7 @@ define( 'UTF8_MAX', "\xf4\x8f\xbf\xbf" /*codepointToUtf8( UNICODE_MAX )*/ ); * @deprecated since 1.25, use UtfNormal\Constants instead */ define( 'UTF8_REPLACEMENT', "\xef\xbf\xbd" /*codepointToUtf8( UNICODE_REPLACEMENT )*/ ); -#define( 'UTF8_REPLACEMENT', '!' ); +# define( 'UTF8_REPLACEMENT', '!' ); /** * @deprecated since 1.25, use UtfNormal\Constants instead diff --git a/includes/content/AbstractContent.php b/includes/content/AbstractContent.php index 6542d7dfad..c98b0ec480 100644 --- a/includes/content/AbstractContent.php +++ b/includes/content/AbstractContent.php @@ -446,7 +446,7 @@ abstract class AbstractContent implements Content { */ public function convert( $toModel, $lossy = '' ) { if ( $this->getModel() === $toModel ) { - //nothing to do, shorten out. + // nothing to do, shorten out. return $this; } diff --git a/includes/content/ContentHandler.php b/includes/content/ContentHandler.php index bf91a4f02e..76f2a7b8d9 100644 --- a/includes/content/ContentHandler.php +++ b/includes/content/ContentHandler.php @@ -630,7 +630,7 @@ abstract class ContentHandler { * @return DifferenceEngine */ public function createDifferenceEngine( IContextSource $context, $old = 0, $new = 0, - $rcid = 0, //FIXME: Deprecated, no longer used + $rcid = 0, // FIXME: Deprecated, no longer used $refreshCache = false, $unhide = false ) { // hook: get difference engine diff --git a/includes/content/MessageContent.php b/includes/content/MessageContent.php index 5b84657f99..e3f93759c3 100644 --- a/includes/content/MessageContent.php +++ b/includes/content/MessageContent.php @@ -83,7 +83,7 @@ class MessageContent extends AbstractContent { * @return Message The message object. */ public function getNativeData() { - //NOTE: Message objects are mutable. Cloning here makes MessageContent immutable. + // NOTE: Message objects are mutable. Cloning here makes MessageContent immutable. return clone $this->mMessage; } diff --git a/includes/db/CloneDatabase.php b/includes/db/CloneDatabase.php index 9eb3e2fa61..bc703f3658 100644 --- a/includes/db/CloneDatabase.php +++ b/includes/db/CloneDatabase.php @@ -98,7 +98,7 @@ class CloneDatabase { } $this->db->dropTable( $tbl, __METHOD__ ); wfDebug( __METHOD__ . " dropping {$newTableName}\n" ); - //Dropping the oldTable because the prefix was changed + // Dropping the oldTable because the prefix was changed } # Create new table diff --git a/includes/db/Database.php b/includes/db/Database.php index dbe86dcc46..d442e4b9ed 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -1347,9 +1347,9 @@ abstract class DatabaseBase implements IDatabase { $preLimitTail .= $this->makeOrderBy( $options ); // if (isset($options['LIMIT'])) { - // $tailOpts .= $this->limitResult('', $options['LIMIT'], - // isset($options['OFFSET']) ? $options['OFFSET'] - // : false); + // $tailOpts .= $this->limitResult('', $options['LIMIT'], + // isset($options['OFFSET']) ? $options['OFFSET'] + // : false); // } if ( isset( $noKeyOptions['FOR UPDATE'] ) ) { @@ -2437,7 +2437,7 @@ abstract class DatabaseBase implements IDatabase { if ( !$alias || (string)$alias === (string)$name ) { return $name; } else { - return $name . ' AS ' . $alias; //PostgreSQL needs AS + return $name . ' AS ' . $alias; // PostgreSQL needs AS } } diff --git a/includes/db/DatabaseOracle.php b/includes/db/DatabaseOracle.php index 87c316467d..ad38c1dcf6 100644 --- a/includes/db/DatabaseOracle.php +++ b/includes/db/DatabaseOracle.php @@ -335,7 +335,7 @@ class DatabaseOracle extends DatabaseBase { MediaWiki\restoreWarnings(); if ( $this->mUser != $this->mDBname ) { - //change current schema in session + // change current schema in session $this->selectDB( $this->mDBname ); } @@ -982,7 +982,7 @@ class DatabaseOracle extends DatabaseBase { * @return string Version information from the database */ function getServerVersion() { - //better version number, fallback on driver + // better version number, fallback on driver $rset = $this->doQuery( 'SELECT version FROM product_component_version ' . 'WHERE UPPER(product) LIKE \'ORACLE DATABASE%\'' diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php index 56a5b2cf1f..aaa1c6ec74 100644 --- a/includes/db/DatabasePostgres.php +++ b/includes/db/DatabasePostgres.php @@ -1581,11 +1581,11 @@ SQL; $preLimitTail .= $this->makeOrderBy( $options ); - //if ( isset( $options['LIMIT'] ) ) { - // $tailOpts .= $this->limitResult( '', $options['LIMIT'], - // isset( $options['OFFSET'] ) ? $options['OFFSET'] - // : false ); - //} + // if ( isset( $options['LIMIT'] ) ) { + // $tailOpts .= $this->limitResult( '', $options['LIMIT'], + // isset( $options['OFFSET'] ) ? $options['OFFSET'] + // : false ); + // } if ( isset( $options['FOR UPDATE'] ) ) { $postLimitTail .= ' FOR UPDATE OF ' . diff --git a/includes/db/loadbalancer/LoadBalancer.php b/includes/db/loadbalancer/LoadBalancer.php index 52dca08758..cdd3d4c09c 100644 --- a/includes/db/loadbalancer/LoadBalancer.php +++ b/includes/db/loadbalancer/LoadBalancer.php @@ -192,7 +192,7 @@ class LoadBalancer { return false; } - #wfDebugLog( 'connect', var_export( $loads, true ) ); + # wfDebugLog( 'connect', var_export( $loads, true ) ); # Return a random representative of the remainder return ArrayUtils::pickRandom( $loads ); diff --git a/includes/deferred/DataUpdate.php b/includes/deferred/DataUpdate.php index c29160fd17..f2421f4a57 100644 --- a/includes/deferred/DataUpdate.php +++ b/includes/deferred/DataUpdate.php @@ -39,7 +39,7 @@ abstract class DataUpdate implements DeferrableUpdate { * This default implementation does nothing. */ public function beginTransaction() { - //noop + // noop } /** @@ -47,7 +47,7 @@ abstract class DataUpdate implements DeferrableUpdate { * This default implementation does nothing. */ public function commitTransaction() { - //noop + // noop } /** @@ -55,7 +55,7 @@ abstract class DataUpdate implements DeferrableUpdate { * This default implementation does nothing. */ public function rollbackTransaction() { - //noop + // noop } /** diff --git a/includes/deferred/SqlDataUpdate.php b/includes/deferred/SqlDataUpdate.php index 49164e3373..0455690a16 100644 --- a/includes/deferred/SqlDataUpdate.php +++ b/includes/deferred/SqlDataUpdate.php @@ -93,7 +93,7 @@ abstract class SqlDataUpdate extends DataUpdate { * Abort the database transaction started via beginTransaction (if any). */ public function abortTransaction() { - if ( $this->mHasTransaction ) { //XXX: actually... maybe always? + if ( $this->mHasTransaction ) { // XXX: actually... maybe always? $this->mDb->rollback( get_class( $this ) . '::abortTransaction' ); $this->mHasTransaction = false; } diff --git a/includes/filerepo/LocalRepo.php b/includes/filerepo/LocalRepo.php index b209bd6750..7aa7919081 100644 --- a/includes/filerepo/LocalRepo.php +++ b/includes/filerepo/LocalRepo.php @@ -251,12 +251,12 @@ class LocalRepo extends FileRepo { $dbr = $this->getSlaveDB(); $id = $dbr->selectField( 'page', // Table - 'page_id', //Field - array( //Conditions + 'page_id', // Field + array( // Conditions 'page_namespace' => $title->getNamespace(), 'page_title' => $title->getDBkey(), ), - __METHOD__ //Function name + __METHOD__ // Function name ); return $id; @@ -424,7 +424,7 @@ class LocalRepo extends FileRepo { */ function findBySha1s( array $hashes ) { if ( !count( $hashes ) ) { - return array(); //empty parameter + return array(); // empty parameter } $dbr = $this->getSlaveDB(); diff --git a/includes/filerepo/RepoGroup.php b/includes/filerepo/RepoGroup.php index 050c429054..c89dca10ea 100644 --- a/includes/filerepo/RepoGroup.php +++ b/includes/filerepo/RepoGroup.php @@ -304,7 +304,7 @@ class RepoGroup { foreach ( $this->foreignRepos as $repo ) { $result = array_merge_recursive( $result, $repo->findBySha1s( $hashes ) ); } - //sort the merged (and presorted) sublist of each hash + // sort the merged (and presorted) sublist of each hash foreach ( $result as $hash => $files ) { usort( $result[$hash], 'File::compare' ); } diff --git a/includes/filerepo/file/File.php b/includes/filerepo/file/File.php index f40d216c58..ec5af854e4 100644 --- a/includes/filerepo/file/File.php +++ b/includes/filerepo/file/File.php @@ -383,7 +383,7 @@ abstract class File implements IDBAccessObject { wfDebug( __METHOD__ . ': supposed to render ' . $this->getName() . ' (' . $this->getMimeType() . "), but can't!\n" ); - return $this->getURL(); #hm... return NULL? + return $this->getURL(); # hm... return NULL? } } else { return $this->getURL(); @@ -806,17 +806,17 @@ abstract class File implements IDBAccessObject { $type = $this->getMediaType(); $mime = $this->getMimeType(); - #wfDebug( "LocalFile::isSafeFile: type= $type, mime= $mime\n" ); + # wfDebug( "LocalFile::isSafeFile: type= $type, mime= $mime\n" ); if ( !$type || $type === MEDIATYPE_UNKNOWN ) { - return false; #unknown type, not trusted + return false; # unknown type, not trusted } if ( in_array( $type, $wgTrustedMediaFormats ) ) { return true; } if ( $mime === "unknown/unknown" ) { - return false; #unknown type, not trusted + return false; # unknown type, not trusted } if ( in_array( $mime, $wgTrustedMediaFormats ) ) { return true; @@ -839,8 +839,8 @@ abstract class File implements IDBAccessObject { * @return bool */ function isTrustedFile() { - #this could be implemented to check a flag in the database, - #look for signatures, etc + # this could be implemented to check a flag in the database, + # look for signatures, etc return false; } diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index d98ca797ea..194adb0d9c 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -1748,7 +1748,7 @@ abstract class Installer { User::newFromName( 'MediaWiki default' ) ); } catch ( Exception $e ) { - //using raw, because $wgShowExceptionDetails can not be set yet + // using raw, because $wgShowExceptionDetails can not be set yet $status->fatal( 'config-install-mainpage-failed', $e->getMessage() ); } diff --git a/includes/installer/PostgresUpdater.php b/includes/installer/PostgresUpdater.php index e1063b0fe4..0c984ced7a 100644 --- a/includes/installer/PostgresUpdater.php +++ b/includes/installer/PostgresUpdater.php @@ -691,8 +691,8 @@ END; } protected function changeFieldPurgeTable( $table, $field, $newtype, $default ) { - ## For a cache table, empty it if the field needs to be changed, because the old contents - ## may be corrupted. If the column is already the desired type, refrain from purging. + # # For a cache table, empty it if the field needs to be changed, because the old contents + # # may be corrupted. If the column is already the desired type, refrain from purging. $fi = $this->db->fieldInfo( $table, $field ); if ( is_null( $fi ) ) { $this->output( "...ERROR: expected column $table.$field to exist\n" ); diff --git a/includes/jobqueue/jobs/RefreshLinksJob.php b/includes/jobqueue/jobs/RefreshLinksJob.php index 935d2fb114..4ba1d4c828 100644 --- a/includes/jobqueue/jobs/RefreshLinksJob.php +++ b/includes/jobqueue/jobs/RefreshLinksJob.php @@ -47,13 +47,13 @@ class RefreshLinksJob extends Job { } // Base backlink update jobs and per-title update jobs can be de-duplicated. // If template A changes twice before any jobs run, a clean queue will have: - // (A base, A base) + // (A base, A base) // The second job is ignored by the queue on insertion. // Suppose, many pages use template A, and that template itself uses template B. // An edit to both will first create two base jobs. A clean FIFO queue will have: - // (A base, B base) + // (A base, B base) // When these jobs run, the queue will have per-title and remnant partition jobs: - // (titleX,titleY,titleZ,...,A remnant,titleM,titleN,titleO,...,B remnant) + // (titleX,titleY,titleZ,...,A remnant,titleM,titleN,titleO,...,B remnant) // Some these jobs will be the same, and will automatically be ignored by // the queue upon insertion. Some title jobs will run before the duplicate is // inserted, so the work will still be done twice in those cases. More titles diff --git a/includes/libs/SamplingStatsdClient.php b/includes/libs/SamplingStatsdClient.php index f7afdb5e13..a8477c90ca 100644 --- a/includes/libs/SamplingStatsdClient.php +++ b/includes/libs/SamplingStatsdClient.php @@ -80,7 +80,7 @@ class SamplingStatsdClient extends StatsdClient { if ( $this->getReducePacket() ) { $data = $this->reduceCount( $data ); } - //failures in any of this should be silently ignored if .. + // failures in any of this should be silently ignored if .. $written = 0; try { $fp = $this->getSender()->open(); diff --git a/includes/logging/BlockLogFormatter.php b/includes/logging/BlockLogFormatter.php index 07ef24b454..72fcc3a5df 100644 --- a/includes/logging/BlockLogFormatter.php +++ b/includes/logging/BlockLogFormatter.php @@ -125,7 +125,7 @@ class BlockLogFormatter extends LogFormatter { public static function formatBlockFlags( $flags, $lang ) { $flags = trim( $flags ); if ( $flags === '' ) { - return ''; //nothing to do + return ''; // nothing to do } $flags = explode( ',', $flags ); $flagsCount = count( $flags ); diff --git a/includes/logging/NewUsersLogFormatter.php b/includes/logging/NewUsersLogFormatter.php index c870d51946..b7068a08a0 100644 --- a/includes/logging/NewUsersLogFormatter.php +++ b/includes/logging/NewUsersLogFormatter.php @@ -59,7 +59,7 @@ class NewUsersLogFormatter extends LogFormatter { public function getPreloadTitles() { $subtype = $this->entry->getSubtype(); if ( $subtype === 'create2' || $subtype === 'byemail' ) { - //add the user talk to LinkBatch for the userLink + // add the user talk to LinkBatch for the userLink return array( Title::makeTitle( NS_USER_TALK, $this->entry->getTarget()->getText() ) ); } diff --git a/includes/media/DjVuImage.php b/includes/media/DjVuImage.php index dac76fad17..3b9b7c97b6 100644 --- a/includes/media/DjVuImage.php +++ b/includes/media/DjVuImage.php @@ -410,11 +410,11 @@ EOT; $xml .= Xml::tags( 'OBJECT', array( - #'data' => '', - #'type' => 'image/x.djvu', + # 'data' => '', + # 'type' => 'image/x.djvu', 'height' => $m[2], 'width' => $m[1], - #'usemap' => '', + # 'usemap' => '', ), "\n" . Xml::element( 'PARAM', array( 'name' => 'DPI', 'value' => $m[3] ) ) . "\n" . diff --git a/includes/media/Exif.php b/includes/media/Exif.php index b4cc43e541..052c39df56 100644 --- a/includes/media/Exif.php +++ b/includes/media/Exif.php @@ -390,8 +390,8 @@ class Exif { $this->charCodeString( 'GPSProcessingMethod' ); $this->charCodeString( 'GPSAreaInformation' ); - //ComponentsConfiguration should really be an array instead of a string... - //This turns a string of binary numbers into an array of numbers. + // ComponentsConfiguration should really be an array instead of a string... + // This turns a string of binary numbers into an array of numbers. if ( isset( $this->mFilteredExifData['ComponentsConfiguration'] ) ) { $val = $this->mFilteredExifData['ComponentsConfiguration']; @@ -401,16 +401,16 @@ class Exif { for ( $i = 0; $i < $strLen; $i++ ) { $ccVals[$i] = ord( substr( $val, $i, 1 ) ); } - $ccVals['_type'] = 'ol'; //this is for formatting later. + $ccVals['_type'] = 'ol'; // this is for formatting later. $this->mFilteredExifData['ComponentsConfiguration'] = $ccVals; } - //GPSVersion(ID) is treated as the wrong type by php exif support. - //Go through each byte turning it into a version string. - //For example: "\x02\x02\x00\x00" -> "2.2.0.0" + // GPSVersion(ID) is treated as the wrong type by php exif support. + // Go through each byte turning it into a version string. + // For example: "\x02\x02\x00\x00" -> "2.2.0.0" - //Also change exif tag name from GPSVersion (what php exif thinks it is) - //to GPSVersionID (what the exif standard thinks it is). + // Also change exif tag name from GPSVersion (what php exif thinks it is) + // to GPSVersionID (what the exif standard thinks it is). if ( isset( $this->mFilteredExifData['GPSVersion'] ) ) { $val = $this->mFilteredExifData['GPSVersion']; @@ -448,7 +448,7 @@ class Exif { if ( isset( $this->mFilteredExifData[$prop] ) ) { if ( strlen( $this->mFilteredExifData[$prop] ) <= 8 ) { - //invalid. Must be at least 9 bytes long. + // invalid. Must be at least 9 bytes long. $this->debug( $this->mFilteredExifData[$prop], __FUNCTION__, false ); unset( $this->mFilteredExifData[$prop] ); @@ -460,13 +460,13 @@ class Exif { switch ( $charCode ) { case "\x4A\x49\x53\x00\x00\x00\x00\x00": - //JIS + // JIS $charset = "Shift-JIS"; break; case "UNICODE\x00": $charset = "UTF-16" . $this->byteOrder; break; - default: //ascii or undefined. + default: // ascii or undefined. $charset = ""; break; } @@ -477,7 +477,7 @@ class Exif { } else { // if valid utf-8, assume that, otherwise assume windows-1252 $valCopy = $val; - UtfNormal\Validator::quickIsNFCVerify( $valCopy ); //validates $valCopy. + UtfNormal\Validator::quickIsNFCVerify( $valCopy ); // validates $valCopy. if ( $valCopy !== $val ) { MediaWiki\suppressWarnings(); $val = iconv( 'Windows-1252', 'UTF-8//IGNORE', $val ); @@ -485,17 +485,17 @@ class Exif { } } - //trim and check to make sure not only whitespace. + // trim and check to make sure not only whitespace. $val = trim( $val ); if ( strlen( $val ) === 0 ) { - //only whitespace. + // only whitespace. $this->debug( $this->mFilteredExifData[$prop], __FUNCTION__, "$prop: Is only whitespace" ); unset( $this->mFilteredExifData[$prop] ); return; } - //all's good. + // all's good. $this->mFilteredExifData[$prop] = $val; } } diff --git a/includes/media/ExifBitmap.php b/includes/media/ExifBitmap.php index b2d24435a2..3537cc665f 100644 --- a/includes/media/ExifBitmap.php +++ b/includes/media/ExifBitmap.php @@ -110,7 +110,7 @@ class ExifBitmapHandler extends BitmapHandler { if ( isset( $exif['MEDIAWIKI_EXIF_VERSION'] ) && $exif['MEDIAWIKI_EXIF_VERSION'] == 1 ) { - //back-compatible but old + // back-compatible but old wfDebug( __METHOD__ . ": back-compat version\n" ); return self::METADATA_COMPATIBLE; diff --git a/includes/media/FormatMetadata.php b/includes/media/FormatMetadata.php index b4892c4c70..a1cb01c171 100644 --- a/includes/media/FormatMetadata.php +++ b/includes/media/FormatMetadata.php @@ -119,9 +119,9 @@ class FormatMetadata extends ContextSource { $type = 'ul'; // default unordered list. } - //This is done differently as the tag is an array. + // This is done differently as the tag is an array. if ( $tag == 'GPSTimeStamp' && count( $vals ) === 3 ) { - //hour min sec array + // hour min sec array $h = explode( '/', $vals[0] ); $m = explode( '/', $vals[1] ); @@ -415,7 +415,7 @@ class FormatMetadata extends ContextSource { 'mode' => ( $val & bindec( '00011000' ) ) >> 3, 'function' => ( $val & bindec( '00100000' ) ) >> 5, 'redeye' => ( $val & bindec( '01000000' ) ) >> 6, -// 'reserved' => ($val & bindec( '10000000' )) >> 7, +// 'reserved' => ($val & bindec( '10000000' )) >> 7, ); $flashMsgs = array(); # We do not need to handle unknown values since all are used. @@ -599,7 +599,7 @@ class FormatMetadata extends ContextSource { } break; - //The GPS...Ref values are kept for compatibility, probably won't be reached. + // The GPS...Ref values are kept for compatibility, probably won't be reached. case 'GPSLatitudeRef': case 'GPSDestLatitudeRef': switch ( $val ) { @@ -732,7 +732,7 @@ class FormatMetadata extends ContextSource { case 'Software': if ( is_array( $val ) ) { - //if its a software, version array. + // if its a software, version array. $val = $this->msg( 'exif-software-version-value', $val[0], $val[1] )->text(); } else { $val = $this->exifMsg( $tag, '', $val ); @@ -1171,7 +1171,7 @@ class FormatMetadata extends ContextSource { $lowLang = strtolower( $lang ); $langName = Language::fetchLanguageName( $lowLang ); if ( $langName === '' ) { - //try just the base language name. (aka en-US -> en ). + // try just the base language name. (aka en-US -> en ). list( $langPrefix ) = explode( '-', $lowLang, 2 ); $langName = Language::fetchLanguageName( $langPrefix ); if ( $langName === '' ) { diff --git a/includes/media/GIFMetadataExtractor.php b/includes/media/GIFMetadataExtractor.php index 6ee23cdad1..f5772de310 100644 --- a/includes/media/GIFMetadataExtractor.php +++ b/includes/media/GIFMetadataExtractor.php @@ -102,14 +102,14 @@ class GIFMetadataExtractor { // Found a frame $frameCount++; - ## Skip bounding box + # # Skip bounding box fread( $fh, 8 ); - ## Read BPP + # # Read BPP $buf = fread( $fh, 1 ); $bpp = self::decodeBPP( $buf ); - ## Read GCT + # # Read GCT self::readGCT( $fh, $bpp ); fread( $fh, 1 ); self::skipBlock( $fh ); diff --git a/includes/media/IPTC.php b/includes/media/IPTC.php index c3d58b8b2c..98fbde3ec0 100644 --- a/includes/media/IPTC.php +++ b/includes/media/IPTC.php @@ -45,13 +45,13 @@ class IPTC { } $c = ''; - //charset info contained in tag 1:90. + // charset info contained in tag 1:90. if ( isset( $parsed['1#090'] ) && isset( $parsed['1#090'][0] ) ) { $c = self::getCharset( $parsed['1#090'][0] ); if ( $c === false ) { - //Unknown charset. refuse to parse. - //note: There is a different between - //unknown and no charset specified. + // Unknown charset. refuse to parse. + // note: There is a different between + // unknown and no charset specified. return array(); } unset( $parsed['1#090'] ); @@ -165,15 +165,15 @@ class IPTC { $software = self::convIPTC( $val, $c ); if ( count( $software ) !== 1 ) { - //according to iim standard this cannot have multiple values - //so if there is more than one, something weird is happening, - //and we skip it. + // according to iim standard this cannot have multiple values + // so if there is more than one, something weird is happening, + // and we skip it. wfDebugLog( 'iptc', 'IPTC: Wrong count on 2:65 Software field' ); break; } if ( isset( $parsed['2#070'] ) ) { - //if a version is set for the software. + // if a version is set for the software. $softwareVersion = self::convIPTC( $parsed['2#070'], $c ); unset( $parsed['2#070'] ); $data['Software'] = array( array( $software[0], $softwareVersion[0] ) ); @@ -220,8 +220,8 @@ class IPTC { // according to spec. // Should potentially store timezone as well. case '2#055': - //Date created (not date digitized). - //Maps to exif DateTimeOriginal + // Date created (not date digitized). + // Maps to exif DateTimeOriginal if ( isset( $parsed['2#060'] ) ) { $time = $parsed['2#060']; } else { @@ -234,8 +234,8 @@ class IPTC { break; case '2#062': - //Date converted to digital representation. - //Maps to exif DateTimeDigitized + // Date converted to digital representation. + // Maps to exif DateTimeDigitized if ( isset( $parsed['2#063'] ) ) { $time = $parsed['2#063']; } else { @@ -248,7 +248,7 @@ class IPTC { break; case '2#030': - //Date released. + // Date released. if ( isset( $parsed['2#035'] ) ) { $time = $parsed['2#035']; } else { @@ -261,7 +261,7 @@ class IPTC { break; case '2#037': - //Date expires. + // Date expires. if ( isset( $parsed['2#038'] ) ) { $time = $parsed['2#038']; } else { @@ -275,10 +275,10 @@ class IPTC { case '2#000': /* iim version */ // unlike other tags, this is a 2-byte binary number. - //technically this is required if there is iptc data - //but in practise it isn't always there. + // technically this is required if there is iptc data + // but in practise it isn't always there. if ( strlen( $val[0] ) == 2 ) { - //if is just to be paranoid. + // if is just to be paranoid. $versionValue = ord( substr( $val[0], 0, 1 ) ) * 256; $versionValue += ord( substr( $val[0], 1, 1 ) ); $data['iimVersion'] = $versionValue; @@ -335,7 +335,7 @@ class IPTC { case '2#085': case '2#038': case '2#035': - //ignore. Handled elsewhere. + // ignore. Handled elsewhere. break; default: @@ -358,8 +358,8 @@ class IPTC { */ private static function timeHelper( $date, $time, $c ) { if ( count( $date ) === 1 ) { - //the standard says this should always be 1 - //just double checking. + // the standard says this should always be 1 + // just double checking. list( $date ) = self::convIPTC( $date, $c ); } else { return null; @@ -369,7 +369,7 @@ class IPTC { list( $time ) = self::convIPTC( $time, $c ); $dateOnly = false; } else { - $time = '000000+0000'; //placeholder + $time = '000000+0000'; // placeholder $dateOnly = true; } @@ -379,7 +379,7 @@ class IPTC { && substr( $date, 4, 2 ) !== '00' && substr( $date, 6, 2 ) !== '00' ) ) { - //something wrong. + // something wrong. // Note, this rejects some valid dates according to iptc spec // for example: the date 00000400 means the photo was taken in // April, but the year and day is unknown. We don't process these @@ -410,7 +410,7 @@ class IPTC { return null; } if ( $dateOnly ) { - //return the date only + // return the date only return substr( $finalTimestamp, 0, 10 ); } else { return $finalTimestamp; @@ -453,12 +453,12 @@ class IPTC { wfDebugLog( 'iptc', __METHOD__ . " Error converting iptc data charset $charset to utf-8" ); } } else { - //treat as utf-8 if is valid utf-8. otherwise pretend its windows-1252 + // treat as utf-8 if is valid utf-8. otherwise pretend its windows-1252 // most of the time if there is no 1:90 tag, it is either ascii, latin1, or utf-8 $oldData = $data; - UtfNormal\Validator::quickIsNFCVerify( $data ); //make $data valid utf-8 + UtfNormal\Validator::quickIsNFCVerify( $data ); // make $data valid utf-8 if ( $data === $oldData ) { - return $data; //if validation didn't change $data + return $data; // if validation didn't change $data } else { return self::convIPTCHelper( $oldData, 'Windows-1252' ); } @@ -477,39 +477,39 @@ class IPTC { */ static function getCharset( $tag ) { - //According to iim standard, charset is defined by the tag 1:90. - //in which there are iso 2022 escape sequences to specify the character set. - //the iim standard seems to encourage that all necessary escape sequences are - //in the 1:90 tag, but says it doesn't have to be. + // According to iim standard, charset is defined by the tag 1:90. + // in which there are iso 2022 escape sequences to specify the character set. + // the iim standard seems to encourage that all necessary escape sequences are + // in the 1:90 tag, but says it doesn't have to be. - //This is in need of more testing probably. This is definitely not complete. - //however reading the docs of some other iptc software, it appears that most iptc software - //only recognizes utf-8. If 1:90 tag is not present content is + // This is in need of more testing probably. This is definitely not complete. + // however reading the docs of some other iptc software, it appears that most iptc software + // only recognizes utf-8. If 1:90 tag is not present content is // usually ascii or iso-8859-1 (and sometimes utf-8), but no guarantee. - //This also won't work if there are more than one escape sequence in the 1:90 tag - //or if something is put in the G2, or G3 charsets, etc. It will only reliably recognize utf-8. + // This also won't work if there are more than one escape sequence in the 1:90 tag + // or if something is put in the G2, or G3 charsets, etc. It will only reliably recognize utf-8. // This is just going through the charsets mentioned in appendix C of the iim standard. // \x1b = ESC. switch ( $tag ) { - case "\x1b%G": //utf-8 - //Also call things that are compatible with utf-8, utf-8 (e.g. ascii) + case "\x1b%G": // utf-8 + // Also call things that are compatible with utf-8, utf-8 (e.g. ascii) case "\x1b(B": // ascii case "\x1b(@": // iso-646-IRV (ascii in latest version, $ different in older version) $c = 'UTF-8'; break; - case "\x1b(A": //like ascii, but british. + case "\x1b(A": // like ascii, but british. $c = 'ISO646-GB'; break; - case "\x1b(C": //some obscure sweedish/finland encoding + case "\x1b(C": // some obscure sweedish/finland encoding $c = 'ISO-IR-8-1'; break; case "\x1b(D": $c = 'ISO-IR-8-2'; break; - case "\x1b(E": //some obscure danish/norway encoding + case "\x1b(E": // some obscure danish/norway encoding $c = 'ISO-IR-9-1'; break; case "\x1b(F": @@ -533,22 +533,22 @@ class IPTC { case "\x1b(K": $c = "ISO646-DE"; break; - case "\x1b(N": //crylic + case "\x1b(N": // crylic $c = "ISO_5427"; break; - case "\x1b(`": //iso646-NO + case "\x1b(`": // iso646-NO $c = "NS_4551-1"; break; - case "\x1b(f": //iso646-FR + case "\x1b(f": // iso646-FR $c = "NF_Z_62-010"; break; case "\x1b(g": - $c = "PT2"; //iso646-PT2 + $c = "PT2"; // iso646-PT2 break; case "\x1b(h": $c = "ES2"; break; - case "\x1b(i": //iso646-HU + case "\x1b(i": // iso646-HU $c = "MSZ_7795.3"; break; case "\x1b(w": @@ -594,7 +594,7 @@ class IPTC { break; default: wfDebugLog( 'iptc', __METHOD__ . 'Unknown charset in iptc 1:90: ' . bin2hex( $tag ) ); - //at this point just give up and refuse to parse iptc? + // at this point just give up and refuse to parse iptc? $c = false; } return $c; diff --git a/includes/media/ImageHandler.php b/includes/media/ImageHandler.php index db74bb35f3..c2870c25ea 100644 --- a/includes/media/ImageHandler.php +++ b/includes/media/ImageHandler.php @@ -61,7 +61,7 @@ abstract class ImageHandler extends MediaHandler { } # Removed for ProofreadPage - #$width = intval( $width ); + # $width = intval( $width ); return "{$width}px"; } diff --git a/includes/media/MediaHandler.php b/includes/media/MediaHandler.php index 9b199212d1..015eb5a84b 100644 --- a/includes/media/MediaHandler.php +++ b/includes/media/MediaHandler.php @@ -180,7 +180,7 @@ abstract class MediaHandler { function convertMetadataVersion( $metadata, $version = 1 ) { if ( !is_array( $metadata ) ) { - //unserialize to keep return parameter consistent. + // unserialize to keep return parameter consistent. MediaWiki\suppressWarnings(); $ret = unserialize( $metadata ); MediaWiki\restoreWarnings(); diff --git a/includes/media/XMP.php b/includes/media/XMP.php index e424b9b981..06311834ea 100644 --- a/includes/media/XMP.php +++ b/includes/media/XMP.php @@ -329,7 +329,7 @@ class XMPReader implements LoggerAwareInterface { $this->charset = 'UTF-8'; break; default: - //this should be impossible to get to + // this should be impossible to get to throw new RuntimeException( "Invalid BOM" ); } } else { @@ -338,7 +338,7 @@ class XMPReader implements LoggerAwareInterface { } } if ( $this->charset !== 'UTF-8' ) { - //don't convert if already utf-8 + // don't convert if already utf-8 MediaWiki\suppressWarnings(); $content = iconv( $this->charset, 'UTF-8//IGNORE', $content ); MediaWiki\restoreWarnings(); diff --git a/includes/media/XMPInfo.php b/includes/media/XMPInfo.php index 1d8d777199..6fc2343869 100644 --- a/includes/media/XMPInfo.php +++ b/includes/media/XMPInfo.php @@ -705,7 +705,7 @@ class XMPInfo { ), 'creator' => array( 'map_group' => 'general', - 'map_name' => 'Artist', //map with exif Artist, iptc byline (2:80) + 'map_name' => 'Artist', // map with exif Artist, iptc byline (2:80) 'mode' => XMPReader::MODE_SEQ, ), 'date' => array( @@ -872,7 +872,7 @@ class XMPInfo { 'mode' => XMPReader::MODE_SIMPLE, ), ), - //Note, this property affects how jpeg metadata is extracted. + // Note, this property affects how jpeg metadata is extracted. 'http://ns.adobe.com/xmp/note/' => array( 'HasExtendedXMP' => array( 'map_group' => 'special', diff --git a/includes/media/XMPValidate.php b/includes/media/XMPValidate.php index 55e8ce796a..519c420cd3 100644 --- a/includes/media/XMPValidate.php +++ b/includes/media/XMPValidate.php @@ -167,7 +167,7 @@ class XMPValidate implements LoggerAwareInterface { return; } - //check if its in a numeric range + // check if its in a numeric range $inRange = false; if ( isset( $info['rangeLow'] ) && isset( $info['rangeHigh'] ) @@ -231,7 +231,7 @@ class XMPValidate implements LoggerAwareInterface { return; } if ( !preg_match( '/^[-A-Za-z0-9]{2,}$/D', $val ) ) { - //this is a rather naive check. + // this is a rather naive check. $this->logger->info( __METHOD__ . " Expected Lang code but got $val" ); $val = null; } @@ -292,8 +292,8 @@ class XMPValidate implements LoggerAwareInterface { return; } - if ( !isset( $res[4] ) ) { //hour - //just have the year month day (if that) + if ( !isset( $res[4] ) ) { // hour + // just have the year month day (if that) $val = $res[1]; if ( isset( $res[2] ) ) { $val .= ':' . $res[2]; @@ -306,7 +306,7 @@ class XMPValidate implements LoggerAwareInterface { } if ( !isset( $res[7] ) || $res[7] === 'Z' ) { - //if hour is set, then minute must also be or regex above will fail. + // if hour is set, then minute must also be or regex above will fail. $val = $res[1] . ':' . $res[2] . ':' . $res[3] . ' ' . $res[4] . ':' . $res[5]; if ( isset( $res[6] ) && $res[6] !== '' ) { diff --git a/includes/page/Article.php b/includes/page/Article.php index 56b9520a78..defd029a25 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -379,7 +379,7 @@ class Article implements Page { # Pre-fill content with error message so that if something # fails we'll have something telling us what we intended. - //XXX: this isn't page content but a UI message. horrible. + // XXX: this isn't page content but a UI message. horrible. $this->mContentObject = new MessageContent( 'missing-revision', array( $oldid ) ); if ( $oldid ) { @@ -1937,7 +1937,7 @@ class Article implements Page { * @return ParserOutput|bool ParserOutput or false if the given revision ID is not found */ public function getParserOutput( $oldid = null, User $user = null ) { - //XXX: bypasses mParserOptions and thus setParserOptions() + // XXX: bypasses mParserOptions and thus setParserOptions() if ( $user === null ) { $parserOptions = $this->getParserOptions(); @@ -2010,7 +2010,7 @@ class Article implements Page { */ public function __get( $fname ) { if ( property_exists( $this->mPage, $fname ) ) { - #wfWarn( "Access to raw $fname field " . __CLASS__ ); + # wfWarn( "Access to raw $fname field " . __CLASS__ ); return $this->mPage->$fname; } trigger_error( 'Inaccessible property via __get(): ' . $fname, E_USER_NOTICE ); @@ -2025,7 +2025,7 @@ class Article implements Page { */ public function __set( $fname, $fvalue ) { if ( property_exists( $this->mPage, $fname ) ) { - #wfWarn( "Access to raw $fname field of " . __CLASS__ ); + # wfWarn( "Access to raw $fname field of " . __CLASS__ ); $this->mPage->$fname = $fvalue; // Note: extensions may want to toss on new fields } elseif ( !in_array( $fname, array( 'mContext', 'mPage' ) ) ) { @@ -2045,7 +2045,7 @@ class Article implements Page { */ public function __call( $fname, $args ) { if ( is_callable( array( $this->mPage, $fname ) ) ) { - #wfWarn( "Call to " . __CLASS__ . "::$fname; please use WikiPage instead" ); + # wfWarn( "Call to " . __CLASS__ . "::$fname; please use WikiPage instead" ); return call_user_func_array( array( $this->mPage, $fname ), $args ); } trigger_error( 'Inaccessible function via __call(): ' . $fname, E_USER_ERROR ); diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index 8b889867af..424d6363cd 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -1434,7 +1434,7 @@ class WikiPage implements Page, IDBAccessObject { ) { ContentHandler::deprecated( __METHOD__, '1.21' ); - //NOTE: keep condition in sync with condition in replaceSectionContent! + // NOTE: keep condition in sync with condition in replaceSectionContent! if ( strval( $sectionId ) === '' ) { // Whole-page edit; let the whole text through return $text; @@ -2046,7 +2046,7 @@ class WikiPage implements Page, IDBAccessObject { } $user = is_null( $user ) ? $wgUser : $user; - //XXX: check $user->getId() here??? + // XXX: check $user->getId() here??? // Use a sane default for $serialFormat, see bug 57026 if ( $serialFormat === null ) { diff --git a/includes/parser/CoreParserFunctions.php b/includes/parser/CoreParserFunctions.php index b0737f60d4..42091a07d6 100644 --- a/includes/parser/CoreParserFunctions.php +++ b/includes/parser/CoreParserFunctions.php @@ -704,15 +704,15 @@ class CoreParserFunctions { // split the given option to its variable if ( self::matchAgainstMagicword( 'rawsuffix', $arg1 ) ) { - //{{pagesincategory:|raw[|type]}} + // {{pagesincategory:|raw[|type]}} $raw = $arg1; $type = $magicWords->matchStartToEnd( $arg2 ); } else { - //{{pagesincategory:[|type[|raw]]}} + // {{pagesincategory:[|type[|raw]]}} $type = $magicWords->matchStartToEnd( $arg1 ); $raw = $arg2; } - if ( !$type ) { //backward compatibility + if ( !$type ) { // backward compatibility $type = 'pagesincategory_all'; } diff --git a/includes/parser/LinkHolderArray.php b/includes/parser/LinkHolderArray.php index b4ca7c8e26..41b5decbed 100644 --- a/includes/parser/LinkHolderArray.php +++ b/includes/parser/LinkHolderArray.php @@ -364,13 +364,13 @@ class LinkHolderArray { # The redirect status and length is passed to getLinkColour via the LinkCache # Use formal parameters instead $colours[$pdbk] = Linker::getLinkColour( $title, $threshold ); - //add id to the extension todolist + // add id to the extension todolist $linkcolour_ids[$s->page_id] = $pdbk; } unset( $res ); } if ( count( $linkcolour_ids ) ) { - //pass an array of page_ids to an extension + // pass an array of page_ids to an extension Hooks::run( 'GetLinkColours', array( $linkcolour_ids, &$colours ) ); } diff --git a/includes/parser/Preprocessor_DOM.php b/includes/parser/Preprocessor_DOM.php index 8a09be839c..562062fcde 100644 --- a/includes/parser/Preprocessor_DOM.php +++ b/includes/parser/Preprocessor_DOM.php @@ -71,7 +71,7 @@ class Preprocessor_DOM implements Preprocessor { * @throws MWException */ public function newPartNodeArray( $values ) { - //NOTE: DOM manipulation is slower than building & parsing XML! (or so Tim sais) + // NOTE: DOM manipulation is slower than building & parsing XML! (or so Tim sais) $xml = ""; foreach ( $values as $k => $val ) { @@ -257,7 +257,7 @@ class Preprocessor_DOM implements Preprocessor { $stack = new PPDStack; - $searchBase = "[{<\n"; #} + $searchBase = "[{<\n"; # } // For fast reverse searches $revText = strrev( $text ); $lengthText = strlen( $text ); @@ -282,7 +282,7 @@ class Preprocessor_DOM implements Preprocessor { $fakeLineStart = true; while ( true ) { - //$this->memCheck(); + // $this->memCheck(); if ( $findOnlyinclude ) { // Ignore all input up to the next diff --git a/includes/parser/Preprocessor_Hash.php b/includes/parser/Preprocessor_Hash.php index 9429e442e7..f536d82218 100644 --- a/includes/parser/Preprocessor_Hash.php +++ b/includes/parser/Preprocessor_Hash.php @@ -200,7 +200,7 @@ class Preprocessor_Hash implements Preprocessor { $fakeLineStart = true; while ( true ) { - //$this->memCheck(); + // $this->memCheck(); if ( $findOnlyinclude ) { // Ignore all input up to the next @@ -1154,7 +1154,7 @@ class PPFrame_Hash implements PPFrame { ) { $out .= $contextNode->firstChild->value; } else { - //$out .= ''; + // $out .= ''; } } elseif ( $contextNode->name == 'ext' ) { # Extension tag diff --git a/includes/registration/ExtensionProcessor.php b/includes/registration/ExtensionProcessor.php index a286f6bf99..84e873dd6c 100644 --- a/includes/registration/ExtensionProcessor.php +++ b/includes/registration/ExtensionProcessor.php @@ -58,7 +58,7 @@ class ExtensionProcessor implements Processor { 'wgRevokePermissions' => 'array_plus_2d', 'wgHooks' => 'array_merge_recursive', // credits are handled in the ExtensionRegistry - //'wgExtensionCredits' => 'array_merge_recursive', + // 'wgExtensionCredits' => 'array_merge_recursive', 'wgExtraGenderNamespaces' => 'array_plus', 'wgNamespacesWithSubpages' => 'array_plus', 'wgNamespaceContentModels' => 'array_plus', diff --git a/includes/search/SearchPostgres.php b/includes/search/SearchPostgres.php index 71e3b63505..60c42496cd 100644 --- a/includes/search/SearchPostgres.php +++ b/includes/search/SearchPostgres.php @@ -65,14 +65,14 @@ class SearchPostgres extends SearchDatabase { wfDebug( "parseQuery received: $term \n" ); - ## No backslashes allowed + # # No backslashes allowed $term = preg_replace( '/\\\/', '', $term ); - ## Collapse parens into nearby words: + # # Collapse parens into nearby words: $term = preg_replace( '/\s*\(\s*/', ' (', $term ); $term = preg_replace( '/\s*\)\s*/', ') ', $term ); - ## Treat colons as word separators: + # # Treat colons as word separators: $term = preg_replace( '/:/', ' ', $term ); $searchstring = ''; @@ -97,22 +97,22 @@ class SearchPostgres extends SearchDatabase { } } - ## Strip out leading junk + # # Strip out leading junk $searchstring = preg_replace( '/^[\s\&\|]+/', '', $searchstring ); - ## Remove any doubled-up operators + # # Remove any doubled-up operators $searchstring = preg_replace( '/([\!\&\|]) +(?:[\&\|] +)+/', "$1 ", $searchstring ); - ## Remove any non-spaced operators (e.g. "Zounds!") + # # Remove any non-spaced operators (e.g. "Zounds!") $searchstring = preg_replace( '/([^ ])[\!\&\|]/', "$1", $searchstring ); - ## Remove any trailing whitespace or operators + # # Remove any trailing whitespace or operators $searchstring = preg_replace( '/[\s\!\&\|]+$/', '', $searchstring ); - ## Remove unnecessary quotes around everything + # # Remove unnecessary quotes around everything $searchstring = preg_replace( '/^[\'"](.*)[\'"]$/', "$1", $searchstring ); - ## Quote the whole thing + # # Quote the whole thing $searchstring = $this->db->addQuotes( $searchstring ); wfDebug( "parseQuery returned: $searchstring \n" ); @@ -132,18 +132,18 @@ class SearchPostgres extends SearchDatabase { # Get the SQL fragment for the given term $searchstring = $this->parseQuery( $term ); - ## We need a separate query here so gin does not complain about empty searches + # # We need a separate query here so gin does not complain about empty searches $sql = "SELECT to_tsquery($searchstring)"; $res = $this->db->query( $sql ); if ( !$res ) { - ## TODO: Better output (example to catch: one 'two) + # # TODO: Better output (example to catch: one 'two) die( "Sorry, that was not a valid search string. Please go back and try again" ); } $top = $res->fetchRow(); $top = $top[0]; $this->searchTerms = array(); - if ( $top === "" ) { ## e.g. if only stopwords are used XXX return something better + if ( $top === "" ) { # # e.g. if only stopwords are used XXX return something better $query = "SELECT page_id, page_namespace, page_title, 0 AS score " . "FROM page p, revision r, pagecontent c WHERE p.page_latest = r.rev_id " . "AND r.rev_text_id = c.old_id AND 1=0"; @@ -162,7 +162,7 @@ class SearchPostgres extends SearchDatabase { "AND r.rev_text_id = c.old_id AND $fulltext @@ to_tsquery($searchstring)"; } - ## Namespaces - defaults to 0 + # # Namespaces - defaults to 0 if ( !is_null( $this->namespaces ) ) { // null -> search all if ( count( $this->namespaces ) < 1 ) { $query .= ' AND page_namespace = 0'; @@ -181,10 +181,10 @@ class SearchPostgres extends SearchDatabase { return $query; } - ## Most of the work of these two functions are done automatically via triggers + # # Most of the work of these two functions are done automatically via triggers function update( $pageid, $title, $text ) { - ## We don't want to index older revisions + # # We don't want to index older revisions $sql = "UPDATE pagecontent SET textvector = NULL WHERE textvector IS NOT NULL and old_id IN " . "(SELECT DISTINCT rev_text_id FROM revision WHERE rev_page = " . intval( $pageid ) . " ORDER BY rev_text_id DESC OFFSET 1)"; diff --git a/includes/site/SiteExporter.php b/includes/site/SiteExporter.php index 169c0d87a5..294f1dba82 100644 --- a/includes/site/SiteExporter.php +++ b/includes/site/SiteExporter.php @@ -105,8 +105,8 @@ class SiteExporter { } } - //@todo: export - //@todo: export + // @todo: export + // @todo: export fwrite( $this->sink, "\t" . Xml::closeElement( 'site' ) . "\n" ); } diff --git a/includes/site/SiteImporter.php b/includes/site/SiteImporter.php index a05bad5dc9..9aefea2518 100644 --- a/includes/site/SiteImporter.php +++ b/includes/site/SiteImporter.php @@ -183,8 +183,8 @@ class SiteImporter { $site->addLocalId( $idType, $id ); } - //@todo: import - //@todo: import + // @todo: import + // @todo: import return $site; } diff --git a/includes/site/SiteList.php b/includes/site/SiteList.php index 2d9f22dd6e..da883d9b0b 100644 --- a/includes/site/SiteList.php +++ b/includes/site/SiteList.php @@ -319,7 +319,7 @@ class SiteList extends GenericArrayObject { * @return array */ protected function getSerializationData() { - //NOTE: When changing the structure, either implement unserialize() to handle the + // NOTE: When changing the structure, either implement unserialize() to handle the // old structure too, or update SERIAL_VERSION_ID to kill any caches. return array_merge( parent::getSerializationData(), diff --git a/includes/specialpage/SpecialPageFactory.php b/includes/specialpage/SpecialPageFactory.php index e794a5dfdc..47b4fc89f1 100644 --- a/includes/specialpage/SpecialPageFactory.php +++ b/includes/specialpage/SpecialPageFactory.php @@ -391,7 +391,7 @@ class SpecialPageFactory { 'closure_expansion' => false, ) ); } elseif ( $rec instanceof SpecialPage ) { - $page = $rec; //XXX: we should deep clone here + $page = $rec; // XXX: we should deep clone here } else { $page = null; } diff --git a/includes/specials/SpecialBooksources.php b/includes/specials/SpecialBooksources.php index 7028fdcb84..53798c0b7f 100644 --- a/includes/specials/SpecialBooksources.php +++ b/includes/specials/SpecialBooksources.php @@ -171,7 +171,7 @@ class SpecialBookSources extends SpecialPage { $content = $rev->getContent(); if ( $content instanceof TextContent ) { - //XXX: in the future, this could be stored as structured data, defining a list of book sources + // XXX: in the future, this could be stored as structured data, defining a list of book sources $text = $content->getNativeData(); $this->getOutput()->addWikiText( str_replace( 'MAGICNUMBER', $this->isbn, $text ) ); diff --git a/includes/specials/SpecialCategories.php b/includes/specials/SpecialCategories.php index 3a13b7ed60..cea6ceb9b6 100644 --- a/includes/specials/SpecialCategories.php +++ b/includes/specials/SpecialCategories.php @@ -134,7 +134,7 @@ class CategoryPager extends AlphabeticPager { } function getIndexField() { -# return array( 'abc' => 'cat_title', 'count' => 'cat_pages' ); +# return array( 'abc' => 'cat_title', 'count' => 'cat_pages' ); return 'cat_title'; } @@ -145,13 +145,13 @@ class CategoryPager extends AlphabeticPager { return $this->mDefaultQuery; } -# protected function getOrderTypeMessages() { -# return array( 'abc' => 'special-categories-sort-abc', -# 'count' => 'special-categories-sort-count' ); -# } +# protected function getOrderTypeMessages() { +# return array( 'abc' => 'special-categories-sort-abc', +# 'count' => 'special-categories-sort-count' ); +# } protected function getDefaultDirections() { -# return array( 'abc' => false, 'count' => true ); +# return array( 'abc' => false, 'count' => true ); return false; } diff --git a/includes/specials/SpecialEditWatchlist.php b/includes/specials/SpecialEditWatchlist.php index 74662aec8e..5f87cf4a99 100644 --- a/includes/specials/SpecialEditWatchlist.php +++ b/includes/specials/SpecialEditWatchlist.php @@ -403,7 +403,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage { */ private function cleanupWatchlist() { if ( !count( $this->badItems ) ) { - return; //nothing to do + return; // nothing to do } $dbw = wfGetDB( DB_MASTER ); diff --git a/includes/specials/SpecialExport.php b/includes/specials/SpecialExport.php index 39c4d77111..642ea6944a 100644 --- a/includes/specials/SpecialExport.php +++ b/includes/specials/SpecialExport.php @@ -385,7 +385,7 @@ class SpecialExport extends SpecialPage { $exporter->allPages(); } else { foreach ( $pages as $page ) { - #Bug 8824: Only export pages the user can read + # Bug 8824: Only export pages the user can read $title = Title::newFromText( $page ); if ( is_null( $title ) ) { // @todo Perhaps output an tag or something. diff --git a/includes/specials/SpecialListgrouprights.php b/includes/specials/SpecialListgrouprights.php index 828a93b9b9..382b03fedd 100644 --- a/includes/specials/SpecialListgrouprights.php +++ b/includes/specials/SpecialListgrouprights.php @@ -234,7 +234,7 @@ class SpecialListGroupRights extends SpecialPage { private function formatPermissions( $permissions, $revoke, $add, $remove, $addSelf, $removeSelf ) { $r = array(); foreach ( $permissions as $permission => $granted ) { - //show as granted only if it isn't revoked to prevent duplicate display of permissions + // show as granted only if it isn't revoked to prevent duplicate display of permissions if ( $granted && ( !isset( $revoke[$permission] ) || !$revoke[$permission] ) ) { $r[] = $this->msg( 'listgrouprights-right-display', User::getRightDescription( $permission ), diff --git a/includes/specials/SpecialListusers.php b/includes/specials/SpecialListusers.php index 31200c84cc..274a95a096 100644 --- a/includes/specials/SpecialListusers.php +++ b/includes/specials/SpecialListusers.php @@ -163,7 +163,7 @@ class UsersPager extends AlphabeticPager { * @return string */ function formatRow( $row ) { - if ( $row->user_id == 0 ) { #Bug 16487 + if ( $row->user_id == 0 ) { # Bug 16487 return ''; } diff --git a/includes/specials/SpecialMovepage.php b/includes/specials/SpecialMovepage.php index ab28fa4784..680a8b8606 100644 --- a/includes/specials/SpecialMovepage.php +++ b/includes/specials/SpecialMovepage.php @@ -616,7 +616,7 @@ class MovePageForm extends UnlistedSpecialPage { $newText = $nt->getPrefixedText(); if ( $ot->exists() ) { - //NOTE: we assume that if the old title exists, it's because it was re-created as + // NOTE: we assume that if the old title exists, it's because it was re-created as // a redirect to the new title. This is not safe, but what we did before was // even worse: we just determined whether a redirect should have been created, // and reported that it was created if it should have, without any checks. diff --git a/includes/specials/SpecialNewpages.php b/includes/specials/SpecialNewpages.php index c8d4aa637c..0fa4857d3a 100644 --- a/includes/specials/SpecialNewpages.php +++ b/includes/specials/SpecialNewpages.php @@ -463,7 +463,7 @@ class SpecialNewpages extends IncludableSpecialPage { protected function feedItemDesc( $row ) { $revision = Revision::newFromId( $row->rev_id ); if ( $revision ) { - //XXX: include content model/type in feed item? + // XXX: include content model/type in feed item? return '

' . htmlspecialchars( $revision->getUserText() ) . $this->msg( 'colon-separator' )->inContentLanguage()->escaped() . htmlspecialchars( FeedItem::stripComment( $revision->getComment() ) ) . diff --git a/includes/specials/SpecialPrefixindex.php b/includes/specials/SpecialPrefixindex.php index 5a67d924bf..d92010a4b8 100644 --- a/includes/specials/SpecialPrefixindex.php +++ b/includes/specials/SpecialPrefixindex.php @@ -180,7 +180,7 @@ class SpecialPrefixindex extends SpecialAllPages { list( $namespace, $prefixKey, $prefix ) = $prefixList; list( /* $fromNS */, $fromKey, ) = $fromList; - ### @todo FIXME: Should complain if $fromNs != $namespace + # ## @todo FIXME: Should complain if $fromNs != $namespace $dbr = wfGetDB( DB_SLAVE ); @@ -205,7 +205,7 @@ class SpecialPrefixindex extends SpecialAllPages { ) ); - ### @todo FIXME: Side link to previous + # ## @todo FIXME: Side link to previous $n = 0; if ( $res->numRows() > 0 ) { diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index 3f67e93d1d..d741b60bb8 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -689,9 +689,9 @@ class SpecialSearch extends SpecialPage { $titleSnippet ); - //If page content is not readable, just return the title. - //This is not quite safe, but better than showing excerpts from non-readable pages - //Note that hiding the entry entirely would screw up paging. + // If page content is not readable, just return the title. + // This is not quite safe, but better than showing excerpts from non-readable pages + // Note that hiding the entry entirely would screw up paging. if ( !$title->userCan( 'read', $this->getUser() ) ) { return "

  • {$link}
  • \n"; } diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php index a66a3d1053..b168b1225e 100644 --- a/includes/specials/SpecialUndelete.php +++ b/includes/specials/SpecialUndelete.php @@ -555,7 +555,7 @@ class PageArchive { $user = User::newFromName( $revision->getUserText( Revision::RAW ), false ); $content = $revision->getContent( Revision::RAW ); - //NOTE: article ID may not be known yet. prepareSave() should not modify the database. + // NOTE: article ID may not be known yet. prepareSave() should not modify the database. $status = $content->prepareSave( $article, 0, -1, $user ); if ( !$status->isOK() ) { diff --git a/includes/specials/SpecialWantedpages.php b/includes/specials/SpecialWantedpages.php index dd4eb0a8b2..02a1f73c12 100644 --- a/includes/specials/SpecialWantedpages.php +++ b/includes/specials/SpecialWantedpages.php @@ -43,10 +43,10 @@ class WantedPagesPage extends WantedQueryPage { $parts = explode( '/', $par, 2 ); $this->limit = (int)$parts[0]; // @todo FIXME: nlinks is ignored - //$nlinks = isset( $parts[1] ) && $parts[1] === 'nlinks'; + // $nlinks = isset( $parts[1] ) && $parts[1] === 'nlinks'; $this->offset = 0; } else { - //$nlinks = true; + // $nlinks = true; } $this->setListoutput( $inc ); $this->shownavigation = !$inc; diff --git a/includes/tidy/RaggettExternal.php b/includes/tidy/RaggettExternal.php index 1193318891..c21bcf83de 100644 --- a/includes/tidy/RaggettExternal.php +++ b/includes/tidy/RaggettExternal.php @@ -37,7 +37,7 @@ class RaggettExternal extends RaggettBase { "{$this->config['tidyBin']} -config {$this->config['tidyConfigFile']} " . $this->config['tidyCommandLine'] . $opts, $descriptorspec, $pipes ); - //NOTE: At least on linux, the process will be created even if tidy is not installed. + // NOTE: At least on linux, the process will be created even if tidy is not installed. // This means that missing tidy will be treated as a validation failure. if ( is_resource( $process ) ) { diff --git a/includes/title/MediaWikiPageLinkRenderer.php b/includes/title/MediaWikiPageLinkRenderer.php index 9ee484190e..27574fa4a0 100644 --- a/includes/title/MediaWikiPageLinkRenderer.php +++ b/includes/title/MediaWikiPageLinkRenderer.php @@ -68,8 +68,8 @@ class MediaWikiPageLinkRenderer implements PageLinkRenderer { * @return string */ public function getPageUrl( TitleValue $page, $params = array() ) { - //TODO: move the code from Linker::linkUrl here! - //The below is just a rough estimation! + // TODO: move the code from Linker::linkUrl here! + // The below is just a rough estimation! $name = $this->formatter->getPrefixedText( $page ); $name = str_replace( ' ', '_', $name ); diff --git a/includes/title/MediaWikiTitleCodec.php b/includes/title/MediaWikiTitleCodec.php index 01575ac0b0..6b2e87714b 100644 --- a/includes/title/MediaWikiTitleCodec.php +++ b/includes/title/MediaWikiTitleCodec.php @@ -76,7 +76,7 @@ class MediaWikiTitleCodec implements TitleFormatter, TitleParser { MWNamespace::hasGenderDistinction( $namespace ) ) { - //NOTE: we are assuming here that the title text is a user name! + // NOTE: we are assuming here that the title text is a user name! $gender = $this->genderCache->getGenderOf( $text, __METHOD__ ); $name = $this->language->getGenderNsText( $namespace, $gender ); } else { @@ -265,7 +265,7 @@ class MediaWikiTitleCodec implements TitleFormatter, TitleParser { # Disallow Talk:File:x type titles... throw new MalformedTitleException( 'title-invalid-talk-namespace', $text ); } elseif ( Interwiki::isValidInterwiki( $x[1] ) ) { - //TODO: get rid of global state! + // TODO: get rid of global state! # Disallow Talk:Interwiki:x type titles... throw new MalformedTitleException( 'title-invalid-talk-namespace', $text ); } diff --git a/includes/upload/UploadBase.php b/includes/upload/UploadBase.php index 30a85aec14..1568859065 100644 --- a/includes/upload/UploadBase.php +++ b/includes/upload/UploadBase.php @@ -1118,10 +1118,10 @@ abstract class UploadBase { 'xxx;zh-hant:\ - // yyy;}- + // yyy;}- // we should split it as: // array( - // [0] => 'zh-hans:xxx' - // [1] => 'zh-hant:yyy' - // [2] => '' - // ) + // [0] => 'zh-hans:xxx' + // [1] => 'zh-hant:yyy' + // [2] => '' + // ) $pat = '/;\s*(?='; foreach ( $this->mVariants as $variant ) { // zh-hans:xxx;zh-hant:yyy diff --git a/languages/classes/LanguageTyv.php b/languages/classes/LanguageTyv.php index 429d0a628b..e0eb103b51 100644 --- a/languages/classes/LanguageTyv.php +++ b/languages/classes/LanguageTyv.php @@ -52,16 +52,16 @@ class LanguageTyv extends Language { $roundFrontVowels = array( "Ó©", "Ò¯", "ö", "ü" ); $unroundBackVowels = array( "а", "ы", "я", "a", "y" ); $roundBackVowels = array( "ё", "о", "у", "ю", "o", "u" ); - //$voicedPhonemes = array( "д", "б", "з", "ж", "г", "d", "b", "z", "g" ); + // $voicedPhonemes = array( "д", "б", "з", "ж", "г", "d", "b", "z", "g" ); $unvoicedPhonemes = array( "т", "п", "с", "ш", "к", "ч", "х", "t", "p", "s", "k", "x" ); $directiveUnvoicedStems = array( "т", "п", "с", "ш", "к", "ч", "х", "л", "м", "н", "Ò£", "t", "p", "s", "k", "x", "l", "m", "n", "ŋ" ); $directiveVoicedStems = array( "д", "б", "з", "ж", "г", "р", "й", "d", "b", "z", "g", "r", "j" ); - //$allSonants = array("л", "м", "н", "Ò£", "р", "й"); - //$allNasals = array("м", "н", "Ò£"); + // $allSonants = array("л", "м", "н", "Ò£", "р", "й"); + // $allNasals = array("м", "н", "Ò£"); - //Put the word in a form we can play with since we're using UTF-8 + // Put the word in a form we can play with since we're using UTF-8 preg_match_all( '/./us', $word, $ar ); // Here's the last letter in the word diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index 04aa3a5e03..dd4ae8dc73 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -460,7 +460,7 @@ abstract class Maintenance { } # Save additional script dependant options to display - # them separately in help + #  them separately in help $this->mDependantParameters = array_diff_key( $this->mParams, $this->mGenericParameters ); } diff --git a/maintenance/backupPrefetch.inc b/maintenance/backupPrefetch.inc index 7bfb7345d9..265800ec06 100644 --- a/maintenance/backupPrefetch.inc +++ b/maintenance/backupPrefetch.inc @@ -193,7 +193,7 @@ class BaseDump { while ( $this->reader->read() ) { switch ( $this->reader->nodeType ) { case XMLReader::TEXT: - //case XMLReader::WHITESPACE: + // case XMLReader::WHITESPACE: case XMLReader::SIGNIFICANT_WHITESPACE: $buffer .= $this->reader->value; break; diff --git a/maintenance/convertLinks.php b/maintenance/convertLinks.php index 221ebe37a3..c3ad46a012 100644 --- a/maintenance/convertLinks.php +++ b/maintenance/convertLinks.php @@ -215,7 +215,7 @@ class ConvertLinks extends Maintenance { } $dbw->freeResult( $res ); # $this->output( "rowOffset: $rowOffset\ttuplesAdded: " - # . "$tuplesAdded\tnumBadLinks: $numBadLinks\n" ); + # . "$tuplesAdded\tnumBadLinks: $numBadLinks\n" ); if ( $tuplesAdded != 0 ) { if ( $reportLinksConvProgress ) { $this->output( "Inserting $tuplesAdded tuples into $links_temp..." ); diff --git a/maintenance/preprocessorFuzzTest.php b/maintenance/preprocessorFuzzTest.php index e1710c142a..4d38710e1f 100644 --- a/maintenance/preprocessorFuzzTest.php +++ b/maintenance/preprocessorFuzzTest.php @@ -212,7 +212,7 @@ class PPFuzzTest { function getReport() { $s = "Title: " . $this->title->getPrefixedDBkey() . "\n" . -// "Output type: {$this->outputType}\n" . +// "Output type: {$this->outputType}\n" . "Entry point: {$this->entryPoint}\n" . "User: " . ( $this->fancySig ? 'fancy' : 'no-fancy' ) . ' ' . var_export( $this->nickname, true ) . "\n" . diff --git a/maintenance/rebuildImages.php b/maintenance/rebuildImages.php index 8e3997878a..b1bb353b08 100644 --- a/maintenance/rebuildImages.php +++ b/maintenance/rebuildImages.php @@ -48,7 +48,7 @@ class ImageBuilder extends Maintenance { parent::__construct(); global $wgUpdateCompatibleMetadata; - //make sure to update old, but compatible img_metadata fields. + // make sure to update old, but compatible img_metadata fields. $wgUpdateCompatibleMetadata = true; $this->mDescription = 'Script to update image metadata records'; diff --git a/maintenance/storage/compressOld.php b/maintenance/storage/compressOld.php index 3cb4a2ba96..16c676d2c8 100644 --- a/maintenance/storage/compressOld.php +++ b/maintenance/storage/compressOld.php @@ -189,7 +189,7 @@ class CompressOld extends Maintenance { if ( false !== strpos( $row->old_flags, 'gzip' ) || false !== strpos( $row->old_flags, 'object' ) ) { - #print "Already compressed row {$row->old_id}\n"; + # print "Already compressed row {$row->old_id}\n"; return false; } $dbw = wfGetDB( DB_MASTER ); @@ -303,8 +303,8 @@ class CompressOld extends Maintenance { # Don't work with current revisions # Don't lock the page table for update either -- TS 2006-04-04 - #$tables[] = 'page'; - #$conds[] = 'page_id=rev_page AND rev_id != page_latest'; + # $tables[] = 'page'; + # $conds[] = 'page_id=rev_page AND rev_id != page_latest'; for ( $pageId = $startId; $pageId <= $maxPageId; $pageId++ ) { wfWaitForSlaves(); @@ -384,7 +384,7 @@ class CompressOld extends Maintenance { if ( $text === false ) { $this->error( "\nError, unable to get text in old_id $oldid" ); - #$dbw->delete( 'old', array( 'old_id' => $oldid ) ); + # $dbw->delete( 'old', array( 'old_id' => $oldid ) ); } if ( $extdb == "" && $j == 0 ) { diff --git a/tests/parser/parserTest.inc b/tests/parser/parserTest.inc index 0a7ebea2e8..543d9bc1d3 100644 --- a/tests/parser/parserTest.inc +++ b/tests/parser/parserTest.inc @@ -1661,7 +1661,7 @@ class ParserTest { } static function getFakeTimestamp( &$parser, &$ts ) { - $ts = 123; //parsed as '1970-01-01T00:02:03Z' + $ts = 123; // parsed as '1970-01-01T00:02:03Z' return true; } } diff --git a/tests/phpunit/MediaWikiTestCase.php b/tests/phpunit/MediaWikiTestCase.php index 0d7192284f..9bbbf9f985 100644 --- a/tests/phpunit/MediaWikiTestCase.php +++ b/tests/phpunit/MediaWikiTestCase.php @@ -1169,7 +1169,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { * @param bool $isHtml */ public static function assertTag( $matcher, $actual, $message = '', $isHtml = true ) { - //trigger_error(__METHOD__ . ' is deprecated', E_USER_DEPRECATED); + // trigger_error(__METHOD__ . ' is deprecated', E_USER_DEPRECATED); self::assertTrue( self::tagMatch( $matcher, $actual, $isHtml ), $message ); } @@ -1184,7 +1184,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { * @param bool $isHtml */ public static function assertNotTag( $matcher, $actual, $message = '', $isHtml = true ) { - //trigger_error(__METHOD__ . ' is deprecated', E_USER_DEPRECATED); + // trigger_error(__METHOD__ . ' is deprecated', E_USER_DEPRECATED); self::assertFalse( self::tagMatch( $matcher, $actual, $isHtml ), $message ); } diff --git a/tests/phpunit/includes/EditPageTest.php b/tests/phpunit/includes/EditPageTest.php index 27959b1d58..51f00832ba 100644 --- a/tests/phpunit/includes/EditPageTest.php +++ b/tests/phpunit/includes/EditPageTest.php @@ -138,7 +138,7 @@ class EditPageTest extends MediaWikiLangTestCase { $page->doEditContent( $content, "base text for test" ); $this->forceRevisionDate( $page, '20120101000000' ); - //sanity check + // sanity check $page->clear(); $currentText = ContentHandler::getContentText( $page->getContent() ); @@ -335,7 +335,7 @@ hello $textWithNewSectionAdded = "$text\n$newSection"; return array( - array( #0 + array( # 0 $text, '', 'hello', @@ -343,7 +343,7 @@ hello 'hello' ), - array( #1 + array( # 1 $text, '1', $sectionOne, @@ -351,7 +351,7 @@ hello $textWithNewSectionOne, ), - array( #2 + array( # 2 $text, 'new', 'hello', @@ -380,14 +380,14 @@ hello public static function provideAutoMerge() { $tests = array(); - $tests[] = array( #0: plain conflict + $tests[] = array( # 0: plain conflict "Elmo", # base edit user "one\n\ntwo\n\nthree\n", - array( #adam's edit + array( # adam's edit 'wpStarttime' => 1, 'wpTextbox1' => "ONE\n\ntwo\n\nthree\n", ), - array( #berta's edit + array( # berta's edit 'wpStarttime' => 2, 'wpTextbox1' => "(one)\n\ntwo\n\nthree\n", ), @@ -396,14 +396,14 @@ hello 'expected edit conflict', # message ); - $tests[] = array( #1: successful merge + $tests[] = array( # 1: successful merge "Elmo", # base edit user "one\n\ntwo\n\nthree\n", - array( #adam's edit + array( # adam's edit 'wpStarttime' => 1, 'wpTextbox1' => "ONE\n\ntwo\n\nthree\n", ), - array( #berta's edit + array( # berta's edit 'wpStarttime' => 2, 'wpTextbox1' => "one\n\ntwo\n\nTHREE\n", ), @@ -424,15 +424,15 @@ hello // generate expected text after merge $expected = str_replace( 'one', 'ONE', str_replace( 'three', 'THREE', $text ) ); - $tests[] = array( #2: merge in section + $tests[] = array( # 2: merge in section "Elmo", # base edit user $text, - array( #adam's edit + array( # adam's edit 'wpStarttime' => 1, 'wpTextbox1' => str_replace( 'one', 'ONE', $section ), 'wpSection' => '1' ), - array( #berta's edit + array( # berta's edit 'wpStarttime' => 2, 'wpTextbox1' => str_replace( 'three', 'THREE', $section ), 'wpSection' => '1' @@ -465,7 +465,7 @@ hello ) { $this->checkHasDiff3(); - //create page + // create page $ns = $this->getDefaultWikitextNS(); $title = Title::newFromText( 'EditPageTest_testAutoMerge', $ns ); $page = WikiPage::factory( $title ); diff --git a/tests/phpunit/includes/FallbackTest.php b/tests/phpunit/includes/FallbackTest.php index c60170f3e5..0a1b7d0ccf 100644 --- a/tests/phpunit/includes/FallbackTest.php +++ b/tests/phpunit/includes/FallbackTest.php @@ -13,7 +13,7 @@ class FallbackTest extends MediaWikiTestCase { $sampleUTF = "Östergötland_coat_of_arms.png"; - //mb_substr + // mb_substr $substr_params = array( array( 0, 0 ), array( 5, -4 ), @@ -35,21 +35,21 @@ class FallbackTest extends MediaWikiTestCase { ); } - //mb_strlen + // mb_strlen $this->assertEquals( mb_strlen( $sampleUTF ), Fallback::mb_strlen( $sampleUTF ), 'Fallback mb_strlen' ); - //mb_str(r?)pos + // mb_str(r?)pos $strpos_params = array( - //array( 'ter' ), - //array( 'Ö' ), - //array( 'Ö', 3 ), - //array( 'oat_', 100 ), - //array( 'c', -10 ), - //Broken for now + // array( 'ter' ), + // array( 'Ö' ), + // array( 'Ö', 3 ), + // array( 'oat_', 100 ), + // array( 'c', -10 ), + // Broken for now ); foreach ( $strpos_params as $param_set ) { diff --git a/tests/phpunit/includes/GlobalFunctions/GlobalTest.php b/tests/phpunit/includes/GlobalFunctions/GlobalTest.php index 69dcd4c982..e39e02f629 100644 --- a/tests/phpunit/includes/GlobalFunctions/GlobalTest.php +++ b/tests/phpunit/includes/GlobalFunctions/GlobalTest.php @@ -306,7 +306,7 @@ class GlobalTest extends MediaWikiTestCase { $this->setMwGlobals( array( 'wgDebugLogFile' => $debugLogFile, - # @todo FIXME: $wgDebugTimestamps should be tested + #  @todo FIXME: $wgDebugTimestamps should be tested 'wgDebugTimestamps' => false ) ); @@ -353,7 +353,7 @@ class GlobalTest extends MediaWikiTestCase { 'gzip;q=1.0' => true, 'foozip' => false, 'foo*zip' => false, - 'gzip;q=abcde' => true, //is this REALLY valid? + 'gzip;q=abcde' => true, // is this REALLY valid? 'gzip;q=12345678.9' => true, ' gzip' => true, ); diff --git a/tests/phpunit/includes/GlobalFunctions/wfUrlencodeTest.php b/tests/phpunit/includes/GlobalFunctions/wfUrlencodeTest.php index d4df7b0060..92115b03ab 100644 --- a/tests/phpunit/includes/GlobalFunctions/wfUrlencodeTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfUrlencodeTest.php @@ -7,7 +7,7 @@ * @covers ::wfUrlencode */ class WfUrlencodeTest extends MediaWikiTestCase { - #### TESTS ############################################################## + # ### TESTS ############################################################## /** * @dataProvider provideURLS @@ -23,7 +23,7 @@ class WfUrlencodeTest extends MediaWikiTestCase { $this->verifyEncodingFor( 'Microsoft-IIS/7', $input, $expected ); } - #### HELPERS ############################################################# + # ### HELPERS ############################################################# /** * Internal helper that actually run the test. @@ -76,7 +76,7 @@ class WfUrlencodeTest extends MediaWikiTestCase { } } - #### PROVIDERS ########################################################### + # ### PROVIDERS ########################################################### /** * Format is either: @@ -91,7 +91,7 @@ class WfUrlencodeTest extends MediaWikiTestCase { */ public static function provideURLS() { return array( - ### RFC 1738 chars + # ## RFC 1738 chars // + is not safe array( '+', '%2B' ), // & and = not safe in queries @@ -109,7 +109,7 @@ class WfUrlencodeTest extends MediaWikiTestCase { ';@$-_.!*', ), - ### Other tests + # ## Other tests // slash remain unchanged. %2F seems to break things array( '/', '/' ), // T105265 diff --git a/tests/phpunit/includes/HtmlTest.php b/tests/phpunit/includes/HtmlTest.php index c5797c4f60..830a7be2fd 100644 --- a/tests/phpunit/includes/HtmlTest.php +++ b/tests/phpunit/includes/HtmlTest.php @@ -103,7 +103,7 @@ class HtmlTest extends MediaWikiTestCase { */ public function testExpandAttributesSkipsNullAndFalse() { - ### EMPTY ######## + # ## EMPTY ######## $this->assertEmpty( Html::expandAttributes( array( 'foo' => null ) ), 'skip keys with null value' @@ -187,7 +187,7 @@ class HtmlTest extends MediaWikiTestCase { * @covers Html::expandAttributes */ public function testExpandAttributesVariousExpansions() { - ### NOT EMPTY #### + # ## NOT EMPTY #### $this->assertEquals( ' empty_string=""', Html::expandAttributes( array( 'empty_string' => '' ) ), @@ -240,7 +240,7 @@ class HtmlTest extends MediaWikiTestCase { * @covers Html::expandAttributes */ public function testExpandAttributesListValueAttributes() { - ### STRING VALUES + # ## STRING VALUES $this->assertEquals( ' class="redundant spaces here"', Html::expandAttributes( array( 'class' => ' redundant spaces here ' ) ), @@ -251,7 +251,7 @@ class HtmlTest extends MediaWikiTestCase { Html::expandAttributes( array( 'class' => 'foo bar foo bar bar' ) ), 'Normalization should remove duplicates in string-lists' ); - ### "EMPTY" ARRAY VALUES + # ## "EMPTY" ARRAY VALUES $this->assertEquals( ' class=""', Html::expandAttributes( array( 'class' => array() ) ), @@ -262,7 +262,7 @@ class HtmlTest extends MediaWikiTestCase { Html::expandAttributes( array( 'class' => array( null, '', ' ', ' ' ) ) ), 'Array with null, empty string and spaces' ); - ### NON-EMPTY ARRAY VALUES + # ## NON-EMPTY ARRAY VALUES $this->assertEquals( ' class="foo bar"', Html::expandAttributes( array( 'class' => array( @@ -528,7 +528,7 @@ class HtmlTest extends MediaWikiTestCase { # Will be mapped to Html::element() $cases = array(); - ### Generic cases, match $attribDefault static array + # ## Generic cases, match $attribDefault static array $cases[] = array( '', 'area', array( 'shape' => 'rect' ) ); @@ -602,7 +602,7 @@ class HtmlTest extends MediaWikiTestCase { 'textarea', array( 'wrap' => 'soft' ) ); - ### SPECIFIC CASES + # ## SPECIFIC CASES # $cases[] = array( '', diff --git a/tests/phpunit/includes/HttpTest.php b/tests/phpunit/includes/HttpTest.php index 8a0dff786a..ea4b6462e0 100644 --- a/tests/phpunit/includes/HttpTest.php +++ b/tests/phpunit/includes/HttpTest.php @@ -95,8 +95,8 @@ class HttpTest extends MediaWikiTestCase { # (\S+) - host part is made of anything not whitespaces // commented these out in order to remove @group Broken // @todo are these valid tests? if so, fix Http::isValidURI so it can handle them - //array( false, 'http://!"èèè¿¿¿~~\'', 'hostname is made of any non whitespace' ), - //array( false, 'http://exam:ple.org/', 'hostname can not use colons!' ), + // array( false, 'http://!"èèè¿¿¿~~\'', 'hostname is made of any non whitespace' ), + // array( false, 'http://exam:ple.org/', 'hostname can not use colons!' ), # (:[0-9]+)? - port number array( true, 'http://example.org:80/' ), diff --git a/tests/phpunit/includes/LinkFilterTest.php b/tests/phpunit/includes/LinkFilterTest.php index 68081059f9..f011f47ccb 100644 --- a/tests/phpunit/includes/LinkFilterTest.php +++ b/tests/phpunit/includes/LinkFilterTest.php @@ -172,7 +172,7 @@ class LinkFilterTest extends MediaWikiLangTestCase { // // array( null, 'http://*.test.com', 'http://www.test.com:80', false ), // array( '', 'https://*.wikimedia.org/r/#/q/status:open,n,z', - // 'https://gerrit.wikimedia.org/XXX/r/#/q/status:open,n,z', false ), + // 'https://gerrit.wikimedia.org/XXX/r/#/q/status:open,n,z', false ), ); } diff --git a/tests/phpunit/includes/LinkerTest.php b/tests/phpunit/includes/LinkerTest.php index 14d0762776..19ab56f80b 100644 --- a/tests/phpunit/includes/LinkerTest.php +++ b/tests/phpunit/includes/LinkerTest.php @@ -30,7 +30,7 @@ class LinkerTest extends MediaWikiLangTestCase { # - optional message return array( - ### ANONYMOUS USER ######################################## + # ## ANONYMOUS USER ######################################## array( 'assertEquals( NS_MAIN, MWNamespace::getAssociated( NS_TALK ) ); } - ### Exceptions with getAssociated() - ### NS_MEDIA and NS_SPECIAL do not have talk pages. MediaWiki raises - ### an exception for them. + # ## Exceptions with getAssociated() + # ## NS_MEDIA and NS_SPECIAL do not have talk pages. MediaWiki raises + # ## an exception for them. /** * @expectedException MWException * @covers MWNamespace::getAssociated @@ -565,7 +565,7 @@ class MWNamespaceTest extends MediaWikiTestCase { $this->assertFalse( MWNamespace::isNonincludable( NS_TEMPLATE ) ); } - ####### HELPERS ########################################################### + # ###### HELPERS ########################################################### function __call( $method, $args ) { // Call the real method if it exists if ( method_exists( $this, $method ) ) { diff --git a/tests/phpunit/includes/RevisionStorageTest.php b/tests/phpunit/includes/RevisionStorageTest.php index 9a429bcb37..301ec5cde2 100644 --- a/tests/phpunit/includes/RevisionStorageTest.php +++ b/tests/phpunit/includes/RevisionStorageTest.php @@ -226,7 +226,7 @@ class RevisionStorageTest extends MediaWikiTestCase { $res = Revision::fetchRevision( $page->getTitle() ); - #note: order is unspecified + # note: order is unspecified $rows = array(); while ( ( $row = $res->fetchObject() ) ) { $rows[$row->rev_id] = $row; @@ -297,7 +297,7 @@ class RevisionStorageTest extends MediaWikiTestCase { $this->assertNull( $rev->getContent(), "getContent() should return null if the revision's text blob could not be loaded." ); - //NOTE: check this twice, once for lazy initialization, and once with the cached value. + // NOTE: check this twice, once for lazy initialization, and once with the cached value. $this->assertNull( $rev->getContent(), "getContent() should return null if the revision's text blob could not be loaded." ); } @@ -462,16 +462,16 @@ class RevisionStorageTest extends MediaWikiTestCase { public static function provideUserWasLastToEdit() { return array( - array( #0 + array( # 0 3, true, # actually the last edit ), - array( #1 + array( # 1 2, true, # not the current edit, but still by this user ), - array( #2 + array( # 2 1, false, # edit by another user ), - array( #3 + array( # 3 0, false, # first edit, by this user, but another user edited in the mean time ), ); diff --git a/tests/phpunit/includes/RevisionTest.php b/tests/phpunit/includes/RevisionTest.php index 4623b38341..eb17588f02 100644 --- a/tests/phpunit/includes/RevisionTest.php +++ b/tests/phpunit/includes/RevisionTest.php @@ -211,7 +211,7 @@ class RevisionTest extends MediaWikiTestCase { } function dataGetContentModel() { - //NOTE: we expect the help namespace to always contain wikitext + // NOTE: we expect the help namespace to always contain wikitext return array( array( 'hello world', 'Help:Hello', null, null, CONTENT_MODEL_WIKITEXT ), array( 'hello world', 'User:hello/there.css', null, null, CONTENT_MODEL_CSS ), @@ -231,7 +231,7 @@ class RevisionTest extends MediaWikiTestCase { } function dataGetContentFormat() { - //NOTE: we expect the help namespace to always contain wikitext + // NOTE: we expect the help namespace to always contain wikitext return array( array( 'hello world', 'Help:Hello', null, null, CONTENT_FORMAT_WIKITEXT ), array( 'hello world', 'Help:Hello', CONTENT_MODEL_CSS, null, CONTENT_FORMAT_CSS ), @@ -252,7 +252,7 @@ class RevisionTest extends MediaWikiTestCase { } function dataGetContentHandler() { - //NOTE: we expect the help namespace to always contain wikitext + // NOTE: we expect the help namespace to always contain wikitext return array( array( 'hello world', 'Help:Hello', null, null, 'WikitextContentHandler' ), array( 'hello world', 'User:hello/there.css', null, null, 'CssContentHandler' ), @@ -272,7 +272,7 @@ class RevisionTest extends MediaWikiTestCase { } function dataGetContent() { - //NOTE: we expect the help namespace to always contain wikitext + // NOTE: we expect the help namespace to always contain wikitext return array( array( 'hello world', 'Help:Hello', null, null, Revision::FOR_PUBLIC, 'hello world' ), array( @@ -312,7 +312,7 @@ class RevisionTest extends MediaWikiTestCase { } function dataGetText() { - //NOTE: we expect the help namespace to always contain wikitext + // NOTE: we expect the help namespace to always contain wikitext return array( array( 'hello world', 'Help:Hello', null, null, Revision::FOR_PUBLIC, 'hello world' ), array( serialize( 'hello world' ), 'Hello', "testing", null, Revision::FOR_PUBLIC, null ), diff --git a/tests/phpunit/includes/StatusTest.php b/tests/phpunit/includes/StatusTest.php index 7ec898fedd..c95e69b60c 100644 --- a/tests/phpunit/includes/StatusTest.php +++ b/tests/phpunit/includes/StatusTest.php @@ -448,14 +448,14 @@ class StatusTest extends MediaWikiLangTestCase { // and the first call to the setUp method. Because of that you can't access any variables // you create there from within a data provider." // http://phpunit.de/manual/3.7/en/writing-tests-for-phpunit.html -// $status = new Status(); -// $status->warning( 'fooBar!' ); -// $status->warning( 'fooBar2!' ); -// $testCases[ '2StringWarnings' ] = array( -// $status, -// array( new Message( 'fooBar!' ), new Message( 'fooBar2!' ) ), -// "* \$1\n* \$2" -// ); +// $status = new Status(); +// $status->warning( 'fooBar!' ); +// $status->warning( 'fooBar2!' ); +// $testCases[ '2StringWarnings' ] = array( +// $status, +// array( new Message( 'fooBar!' ), new Message( 'fooBar2!' ) ), +// "* \$1\n* \$2" +// ); $status = new Status(); $status->warning( new Message( 'fooBar!', array( 'foo', 'bar' ) ) ); diff --git a/tests/phpunit/includes/TitleArrayFromResultTest.php b/tests/phpunit/includes/TitleArrayFromResultTest.php index 6654a5b6df..aad435e777 100644 --- a/tests/phpunit/includes/TitleArrayFromResultTest.php +++ b/tests/phpunit/includes/TitleArrayFromResultTest.php @@ -113,7 +113,7 @@ class TitleArrayFromResultTest extends PHPUnit_Framework_TestCase { $this->assertEquals( $expected, $object->valid() ); } - //@todo unit test for key() - //@todo unit test for next() - //@todo unit test for rewind() + // @todo unit test for key() + // @todo unit test for next() + // @todo unit test for rewind() } diff --git a/tests/phpunit/includes/TitlePermissionTest.php b/tests/phpunit/includes/TitlePermissionTest.php index f588ed63b7..1318d104c1 100644 --- a/tests/phpunit/includes/TitlePermissionTest.php +++ b/tests/phpunit/includes/TitlePermissionTest.php @@ -248,7 +248,7 @@ class TitlePermissionTest extends MediaWikiLangTestCase { ); if ( $this->isWikitextNS( NS_MAIN ) ) { - //NOTE: some content models don't allow moving + // NOTE: some content models don't allow moving // @todo find a Wikitext namespace for testing $this->setTitle( NS_MAIN ); diff --git a/tests/phpunit/includes/TitleTest.php b/tests/phpunit/includes/TitleTest.php index a2c6f23df4..5ede0ab2fa 100644 --- a/tests/phpunit/includes/TitleTest.php +++ b/tests/phpunit/includes/TitleTest.php @@ -99,9 +99,9 @@ class TitleTest extends MediaWikiTestCase { // XML/HTML character entity references // Note: Commented out because they are not marked invalid by the PHP test as // Title::newFromText runs Sanitizer::decodeCharReferencesAndNormalize first. - //'A é B', - //'A é B', - //'A é B', + // 'A é B', + // 'A é B', + // 'A é B', // Subject of NS_TALK does not roundtrip to NS_MAIN array( 'Talk:File:Example.svg', 'title-invalid-talk-namespace' ), // Directory navigation diff --git a/tests/phpunit/includes/UserArrayFromResultTest.php b/tests/phpunit/includes/UserArrayFromResultTest.php index 62989faad0..469ad29671 100644 --- a/tests/phpunit/includes/UserArrayFromResultTest.php +++ b/tests/phpunit/includes/UserArrayFromResultTest.php @@ -108,7 +108,7 @@ class UserArrayFromResultTest extends MediaWikiTestCase { $this->assertEquals( $expected, $object->valid() ); } - //@todo unit test for key() - //@todo unit test for next() - //@todo unit test for rewind() + // @todo unit test for key() + // @todo unit test for next() + // @todo unit test for rewind() } diff --git a/tests/phpunit/includes/api/ApiEditPageTest.php b/tests/phpunit/includes/api/ApiEditPageTest.php index 61a8ad11c3..6a2428157b 100644 --- a/tests/phpunit/includes/api/ApiEditPageTest.php +++ b/tests/phpunit/includes/api/ApiEditPageTest.php @@ -106,22 +106,22 @@ class ApiEditPageTest extends ApiTestCase { */ public static function provideEditAppend() { return array( - array( #0: append + array( # 0: append 'foo', 'append', 'bar', "foobar" ), - array( #1: prepend + array( # 1: prepend 'foo', 'prepend', 'bar', "barfoo" ), - array( #2: append to empty page + array( # 2: append to empty page '', 'append', 'foo', "foo" ), - array( #3: prepend to empty page + array( # 3: prepend to empty page '', 'prepend', 'foo', "foo" ), - array( #4: append to non-existing page + array( # 4: append to non-existing page null, 'append', 'foo', "foo" ), - array( #5: prepend to non-existing page + array( # 5: prepend to non-existing page null, 'prepend', 'foo', "foo" ), ); diff --git a/tests/phpunit/includes/api/ApiWatchTest.php b/tests/phpunit/includes/api/ApiWatchTest.php index e49c6c0e4e..dc86b2284d 100644 --- a/tests/phpunit/includes/api/ApiWatchTest.php +++ b/tests/phpunit/includes/api/ApiWatchTest.php @@ -98,7 +98,7 @@ class ApiWatchTest extends ApiTestCase { $this->getTokens(); if ( !Title::newFromText( 'Help:UTPage' )->exists() ) { - $this->markTestSkipped( "The article [[Help:UTPage]] does not exist" ); //TODO: just create it? + $this->markTestSkipped( "The article [[Help:UTPage]] does not exist" ); // TODO: just create it? } $data = $this->doApiRequest( array( diff --git a/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php b/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php index db61bc8074..3960e8802c 100644 --- a/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php +++ b/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php @@ -74,7 +74,7 @@ abstract class ApiQueryContinueTestBase extends ApiQueryTestBase { return strcmp( $a, $b ); } ); $reqStr = http_build_query( $request ); - //$reqStr = str_replace( '&', ' & ', $reqStr ); + // $reqStr = str_replace( '&', ' & ', $reqStr ); $this->assertLessThan( $expectedCount, $count, "$id more data: $reqStr" ); if ( $this->mVerbose ) { print "$id (#$count): $reqStr\n"; diff --git a/tests/phpunit/includes/cache/GenderCacheTest.php b/tests/phpunit/includes/cache/GenderCacheTest.php index 04fb00d98a..6b22000116 100644 --- a/tests/phpunit/includes/cache/GenderCacheTest.php +++ b/tests/phpunit/includes/cache/GenderCacheTest.php @@ -7,7 +7,7 @@ class GenderCacheTest extends MediaWikiLangTestCase { function addDBData() { - //ensure the correct default gender + // ensure the correct default gender $this->mergeMwGlobalArrayValue( 'wgDefaultUserOptions', array( 'gender' => 'unknown' ) ); $user = User::newFromName( 'UTMale' ); @@ -15,7 +15,7 @@ class GenderCacheTest extends MediaWikiLangTestCase { $user->addToDatabase(); $user->setPassword( 'UTMalePassword' ); } - //ensure the right gender + // ensure the right gender $user->setOption( 'gender', 'male' ); $user->saveSettings(); @@ -24,7 +24,7 @@ class GenderCacheTest extends MediaWikiLangTestCase { $user->addToDatabase(); $user->setPassword( 'UTFemalePassword' ); } - //ensure the right gender + // ensure the right gender $user->setOption( 'gender', 'female' ); $user->saveSettings(); @@ -33,7 +33,7 @@ class GenderCacheTest extends MediaWikiLangTestCase { $user->addToDatabase(); $user->setPassword( 'UTDefaultGenderPassword' ); } - //ensure the default gender + // ensure the default gender $user->setOption( 'gender', null ); $user->saveSettings(); } @@ -69,7 +69,7 @@ class GenderCacheTest extends MediaWikiLangTestCase { array( 'UTFemale', 'female' ), array( 'UTDefaultGender', 'unknown' ), array( 'UTNotExist', 'unknown' ), - //some not valid user + // some not valid user array( '127.0.0.1', 'unknown' ), array( 'user@test', 'unknown' ), ); diff --git a/tests/phpunit/includes/content/TextContentTest.php b/tests/phpunit/includes/content/TextContentTest.php index fe263756a0..06609d8fe5 100644 --- a/tests/phpunit/includes/content/TextContentTest.php +++ b/tests/phpunit/includes/content/TextContentTest.php @@ -93,12 +93,12 @@ class TextContentTest extends MediaWikiLangTestCase { public static function dataPreSaveTransform() { return array( array( - #0: no signature resolution + # 0: no signature resolution 'hello this is ~~~', 'hello this is ~~~', ), array( - #1: rtrim + # 1: rtrim " Foo \n ", ' Foo', ), @@ -421,7 +421,7 @@ class TextContentTest extends MediaWikiLangTestCase { $update = $updates[$class]; foreach ( $fieldValues as $field => $value ) { - $v = $update->$field; #if the field doesn't exist, just crash and burn + $v = $update->$field; # if the field doesn't exist, just crash and burn $this->assertEquals( $value, $v, "unexpected value for field $field in instance of $class" ); } } diff --git a/tests/phpunit/includes/content/WikitextContentTest.php b/tests/phpunit/includes/content/WikitextContentTest.php index 7becd6f434..b436ebfa97 100644 --- a/tests/phpunit/includes/content/WikitextContentTest.php +++ b/tests/phpunit/includes/content/WikitextContentTest.php @@ -89,7 +89,7 @@ more stuff $update = $updates[$class]; foreach ( $fieldValues as $field => $value ) { - $v = $update->$field; #if the field doesn't exist, just crash and burn + $v = $update->$field; # if the field doesn't exist, just crash and burn $this->assertEquals( $value, $v, "unexpected value for field $field in instance of $class" ); } } diff --git a/tests/phpunit/includes/db/DatabaseSqliteTest.php b/tests/phpunit/includes/db/DatabaseSqliteTest.php index 3db9172afb..9307b0cda9 100644 --- a/tests/phpunit/includes/db/DatabaseSqliteTest.php +++ b/tests/phpunit/includes/db/DatabaseSqliteTest.php @@ -295,7 +295,7 @@ class DatabaseSqliteTest extends MediaWikiTestCase { // Versions tested $versions = array( - //'1.13', disabled for now, was totally screwed up + // '1.13', disabled for now, was totally screwed up // SQLite wasn't included in 1.14 '1.15', '1.16', diff --git a/tests/phpunit/includes/deferred/LinksUpdateTest.php b/tests/phpunit/includes/deferred/LinksUpdateTest.php index 02f6b2ab2d..bbd196d3d2 100644 --- a/tests/phpunit/includes/deferred/LinksUpdateTest.php +++ b/tests/phpunit/includes/deferred/LinksUpdateTest.php @@ -255,7 +255,7 @@ class LinksUpdateTest extends MediaWikiTestCase { ) { $update = new LinksUpdate( $title, $parserOutput ); - //NOTE: make sure LinksUpdate does not generate warnings when called inside a transaction. + // NOTE: make sure LinksUpdate does not generate warnings when called inside a transaction. $update->beginTransaction(); $update->doUpdate(); $update->commitTransaction(); diff --git a/tests/phpunit/includes/filebackend/FileBackendTest.php b/tests/phpunit/includes/filebackend/FileBackendTest.php index 2e4942f0d8..d40e5274fa 100644 --- a/tests/phpunit/includes/filebackend/FileBackendTest.php +++ b/tests/phpunit/includes/filebackend/FileBackendTest.php @@ -1517,7 +1517,7 @@ class FileBackendTest extends MediaWikiTestCase { array( "$base/unittest-cont1/e/a/z/some_file1.txt", true ), array( "$base/unittest-cont2/a/z/some_file2.txt", true ), # Specific to FS backend with no basePath field set - #array( "$base/unittest-cont3/a/z/some_file3.txt", false ), + # array( "$base/unittest-cont3/a/z/some_file3.txt", false ), ); } @@ -2347,7 +2347,7 @@ class FileBackendTest extends MediaWikiTestCase { $this->assertEquals( true, $status->isOK(), "Locking of files succeeded with OK status ($backendName) ($i)." ); - ## Flip the acquire/release ordering around ## + # # Flip the acquire/release ordering around ## $status = $this->backend->lockFiles( $paths, LockManager::LOCK_SH ); $this->assertEquals( print_r( array(), true ), print_r( $status->errors, true ), diff --git a/tests/phpunit/includes/media/DjVuTest.php b/tests/phpunit/includes/media/DjVuTest.php index c0871f19fc..31cda64b23 100644 --- a/tests/phpunit/includes/media/DjVuTest.php +++ b/tests/phpunit/includes/media/DjVuTest.php @@ -13,7 +13,7 @@ class DjVuTest extends MediaWikiMediaTestCase { protected function setUp() { parent::setUp(); - //cli tool setup + // cli tool setup $djvuSupport = new DjVuSupport(); if ( !$djvuSupport->isEnabled() ) { diff --git a/tests/phpunit/includes/media/PNGTest.php b/tests/phpunit/includes/media/PNGTest.php index 96ede90de1..5f1f6caec9 100644 --- a/tests/phpunit/includes/media/PNGTest.php +++ b/tests/phpunit/includes/media/PNGTest.php @@ -93,7 +93,7 @@ class PNGHandlerTest extends MediaWikiMediaTestCase { public function testGetMetadata( $filename, $expected ) { $file = $this->dataFile( $filename, 'image/png' ); $actual = $this->handler->getMetadata( $file, "$this->filePath/$filename" ); -// $this->assertEquals( unserialize( $expected ), unserialize( $actual ) ); +// $this->assertEquals( unserialize( $expected ), unserialize( $actual ) ); $this->assertEquals( ( $expected ), ( $actual ) ); } diff --git a/tests/phpunit/includes/page/WikiPageTest.php b/tests/phpunit/includes/page/WikiPageTest.php index c011e9a9d3..ec08ef4b72 100644 --- a/tests/phpunit/includes/page/WikiPageTest.php +++ b/tests/phpunit/includes/page/WikiPageTest.php @@ -160,7 +160,7 @@ class WikiPageTest extends MediaWikiLangTestCase { $this->hideDeprecated( "WikiPage::getText" ); $this->hideDeprecated( "Revision::getText" ); - //NOTE: assume help namespace will default to wikitext + // NOTE: assume help namespace will default to wikitext $title = Title::newFromText( "Help:WikiPageTest_testDoEdit" ); $page = $this->newPage( $title ); @@ -220,7 +220,7 @@ class WikiPageTest extends MediaWikiLangTestCase { $this->hideDeprecated( "WikiPage::doQuickEdit" ); - //NOTE: assume help namespace will default to wikitext + // NOTE: assume help namespace will default to wikitext $page = $this->createPage( "Help:WikiPageTest_testDoQuickEdit", "original text" ); $text = "quick text"; @@ -743,7 +743,7 @@ more stuff "; public function dataReplaceSection() { - //NOTE: assume the Help namespace to contain wikitext + // NOTE: assume the Help namespace to contain wikitext return array( array( 'Help:WikiPageTest_testReplaceSection', CONTENT_MODEL_WIKITEXT, @@ -938,7 +938,7 @@ more stuff $this->assertEquals( 'Admin', $rev1->getUserText() ); # now, try the actual rollback - $admin->addGroup( "sysop" ); #XXX: make the test user a sysop... + $admin->addGroup( "sysop" ); # XXX: make the test user a sysop... $token = $admin->getEditToken( array( $page->getTitle()->getPrefixedText(), $user2->getName() ), null @@ -995,7 +995,7 @@ more stuff ); # now, try the rollback - $admin->addGroup( "sysop" ); #XXX: make the test user a sysop... + $admin->addGroup( "sysop" ); # XXX: make the test user a sysop... $token = $admin->getEditToken( array( $page->getTitle()->getPrefixedText(), $user1->getName() ), null @@ -1026,7 +1026,7 @@ more stuff public function testDoRollbackFailureSameContent() { $admin = new User(); $admin->setName( "Admin" ); - $admin->addGroup( "sysop" ); #XXX: make the test user a sysop... + $admin->addGroup( "sysop" ); # XXX: make the test user a sysop... $text = "one"; $page = $this->newPage( "WikiPageTest_testDoRollback" ); @@ -1041,7 +1041,7 @@ more stuff $user1 = new User(); $user1->setName( "127.0.1.11" ); - $user1->addGroup( "sysop" ); #XXX: make the test user a sysop... + $user1->addGroup( "sysop" ); # XXX: make the test user a sysop... $text .= "\n\ntwo"; $page = new WikiPage( $page->getTitle() ); $page->doEditContent( @@ -1219,7 +1219,7 @@ more stuff public function testGetAutoDeleteReason( $edits, $expectedResult, $expectedHistory ) { global $wgUser; - //NOTE: assume Help namespace to contain wikitext + // NOTE: assume Help namespace to contain wikitext $page = $this->newPage( "Help:WikiPageTest_testGetAutoDeleteReason" ); $c = 1; @@ -1275,7 +1275,7 @@ more stuff $user = new User(); $user->setName( "127.0.0.1" ); - //NOTE: assume Help namespace to contain wikitext + // NOTE: assume Help namespace to contain wikitext $page = $this->newPage( "Help:WikiPageTest_testPreloadTransform" ); $text = $page->preSaveTransform( $text, $user ); diff --git a/tests/phpunit/includes/parser/MagicVariableTest.php b/tests/phpunit/includes/parser/MagicVariableTest.php index cd54a9e3c0..8997846597 100644 --- a/tests/phpunit/includes/parser/MagicVariableTest.php +++ b/tests/phpunit/includes/parser/MagicVariableTest.php @@ -84,7 +84,7 @@ class MagicVariableTest extends MediaWikiTestCase { return self::createProviderUpTo( 31 ); } - ############### TESTS ############################################# + # ############## TESTS ############################################# # @todo FIXME: # - those got copy pasted, we can probably make them cleaner # - tests are lacking useful messages @@ -157,7 +157,7 @@ class MagicVariableTest extends MediaWikiTestCase { $this->assertUnPadded( 'revisionmonth1', $month ); } - ############### HELPERS ############################################ + # ############## HELPERS ############################################ /** assertion helper expecting a magic output which is zero padded */ public function assertZeroPadded( $magic, $value ) { @@ -189,7 +189,7 @@ class MagicVariableTest extends MediaWikiTestCase { ); # please keep the following commented line of code. It helps debugging. - //print "\nDEBUG (value $value):" . sprintf( '2010%02d%02d123456', $value, $value ) . "\n"; + // print "\nDEBUG (value $value):" . sprintf( '2010%02d%02d123456', $value, $value ) . "\n"; # format expectation and test it $expected = sprintf( $format, $value ); diff --git a/tests/phpunit/includes/parser/NewParserTest.php b/tests/phpunit/includes/parser/NewParserTest.php index df7da98c62..ff4a5271f2 100644 --- a/tests/phpunit/includes/parser/NewParserTest.php +++ b/tests/phpunit/includes/parser/NewParserTest.php @@ -27,7 +27,7 @@ class NewParserTest extends MediaWikiTestCase { public $functionHooks = array(); public $transparentHooks = array(); - //Fuzz test + // Fuzz test public $maxFuzzTestLength = 300; public $fuzzSeed = 0; public $memoryLimit = 50; @@ -54,7 +54,7 @@ class NewParserTest extends MediaWikiTestCase { parent::setUp(); - //Setup CLI arguments + // Setup CLI arguments if ( $this->getCliArg( 'regex' ) ) { $this->regex = $this->getCliArg( 'regex' ); } else { @@ -210,7 +210,7 @@ class NewParserTest extends MediaWikiTestCase { function addDBData() { $this->tablesUsed[] = 'site_stats'; # disabled for performance - #$this->tablesUsed[] = 'image'; + # $this->tablesUsed[] = 'image'; # Update certain things in site_stats $this->db->insert( 'site_stats', @@ -346,7 +346,7 @@ class NewParserTest extends MediaWikiTestCase { } } - //ParserTest setup/teardown functions + // ParserTest setup/teardown functions /** * Set up the global variables for a consistent environment for each test. @@ -426,7 +426,7 @@ class NewParserTest extends MediaWikiTestCase { foreach ( $configLines as $line ) { list( $var, $value ) = explode( '=', $line, 2 ); - $settings[$var] = eval( "return $value;" ); //??? + $settings[$var] = eval( "return $value;" ); // ??? } } @@ -682,7 +682,7 @@ class NewParserTest extends MediaWikiTestCase { public function testParserTest( $desc, $input, $result, $opts, $config ) { if ( $this->regex != '' && !preg_match( '/' . $this->regex . '/', $desc ) ) { $this->assertTrue( true ); // XXX: don't flood output with "test made no assertions" - //$this->markTestSkipped( 'Filtered out by the user' ); + // $this->markTestSkipped( 'Filtered out by the user' ); return; } @@ -865,7 +865,7 @@ class NewParserTest extends MediaWikiTestCase { if ( $id % 100 == 0 ) { $usage = intval( memory_get_usage( true ) / $this->memoryLimit / 1048576 * 100 ); - //echo "{$this->fuzzSeed}: $numSuccess/$numTotal (mem: $usage%)\n"; + // echo "{$this->fuzzSeed}: $numSuccess/$numTotal (mem: $usage%)\n"; if ( $usage > 90 ) { $ret = "Out of memory:\n"; $memStats = $this->getMemoryBreakdown(); @@ -882,7 +882,7 @@ class NewParserTest extends MediaWikiTestCase { } } - //Various getter functions + // Various getter functions /** * Get an input dictionary from a set of parser test files @@ -956,7 +956,7 @@ class NewParserTest extends MediaWikiTestCase { return $parser; } - //Various action functions + // Various action functions public function addArticle( $name, $text, $line ) { self::$articles[$name] = array( $text, $line ); @@ -999,7 +999,7 @@ class NewParserTest extends MediaWikiTestCase { return isset( $wgParser->mTransparentTagHooks[$name] ); } - //Various "cleanup" functions + // Various "cleanup" functions /** * Remove last character if it is a newline @@ -1014,7 +1014,7 @@ class NewParserTest extends MediaWikiTestCase { } } - //Test options parser functions + // Test options parser functions protected function parseOptions( $instring ) { $opts = array(); diff --git a/tests/phpunit/includes/password/UserPasswordPolicyTest.php b/tests/phpunit/includes/password/UserPasswordPolicyTest.php index ce4e30abb6..b419203f34 100644 --- a/tests/phpunit/includes/password/UserPasswordPolicyTest.php +++ b/tests/phpunit/includes/password/UserPasswordPolicyTest.php @@ -191,41 +191,41 @@ class UserPasswordPolicyTest extends MediaWikiTestCase { public function provideMaxOfPolicies() { return array( array( - array( 'MinimalPasswordLength' => 8 ), //p1 - array( 'MinimalPasswordLength' => 2 ), //p2 - array( 'MinimalPasswordLength' => 8 ), //max + array( 'MinimalPasswordLength' => 8 ), // p1 + array( 'MinimalPasswordLength' => 2 ), // p2 + array( 'MinimalPasswordLength' => 8 ), // max 'Basic max in p1' ), array( - array( 'MinimalPasswordLength' => 2 ), //p1 - array( 'MinimalPasswordLength' => 8 ), //p2 - array( 'MinimalPasswordLength' => 8 ), //max + array( 'MinimalPasswordLength' => 2 ), // p1 + array( 'MinimalPasswordLength' => 8 ), // p2 + array( 'MinimalPasswordLength' => 8 ), // max 'Basic max in p2' ), array( - array( 'MinimalPasswordLength' => 8 ), //p1 + array( 'MinimalPasswordLength' => 8 ), // p1 array( 'MinimalPasswordLength' => 2, 'PasswordCannotMatchUsername' => 1, - ), //p2 + ), // p2 array( 'MinimalPasswordLength' => 8, 'PasswordCannotMatchUsername' => 1, - ), //max + ), // max 'Missing items in p1' ), array( array( 'MinimalPasswordLength' => 8, 'PasswordCannotMatchUsername' => 1, - ), //p1 + ), // p1 array( 'MinimalPasswordLength' => 2, - ), //p2 + ), // p2 array( 'MinimalPasswordLength' => 8, 'PasswordCannotMatchUsername' => 1, - ), //max + ), // max 'Missing items in p2' ), ); diff --git a/tests/phpunit/includes/site/MediaWikiSiteTest.php b/tests/phpunit/includes/site/MediaWikiSiteTest.php index ef2ccca279..3b95c46965 100644 --- a/tests/phpunit/includes/site/MediaWikiSiteTest.php +++ b/tests/phpunit/includes/site/MediaWikiSiteTest.php @@ -38,7 +38,7 @@ class MediaWikiSiteTest extends SiteTest { $site = new MediaWikiSite(); $site->setGlobalId( 'enwiki' ); - //NOTE: this does not actually call out to the enwiki site to perform the normalization, + // NOTE: this does not actually call out to the enwiki site to perform the normalization, // but uses a local Title object to do so. This is hardcoded on SiteLink::normalizePageTitle // for the case that MW_PHPUNIT_TEST is set. $this->assertEquals( 'Foo', $site->normalizePageName( ' foo ' ) ); diff --git a/tests/phpunit/includes/site/SiteTest.php b/tests/phpunit/includes/site/SiteTest.php index 63d90d2e92..2f785b5fca 100644 --- a/tests/phpunit/includes/site/SiteTest.php +++ b/tests/phpunit/includes/site/SiteTest.php @@ -228,23 +228,23 @@ class SiteTest extends MediaWikiTestCase { } public static function provideGetPageUrl() { - //NOTE: the assumption that the URL is built by replacing $1 + // NOTE: the assumption that the URL is built by replacing $1 // with the urlencoded version of $page // is true for Site but not guaranteed for subclasses. // Subclasses need to override this provider appropriately. return array( - array( #0 + array( # 0 'http://acme.test/TestPath/$1', 'Foo', '/TestPath/Foo', ), - array( #1 + array( # 1 'http://acme.test/TestScript?x=$1&y=bla', 'Foo', 'TestScript?x=Foo&y=bla', ), - array( #2 + array( # 2 'http://acme.test/TestPath/$1', 'foo & bar/xyzzy (quux-shmoox?)', '/TestPath/foo%20%26%20bar%2Fxyzzy%20%28quux-shmoox%3F%29', @@ -259,7 +259,7 @@ class SiteTest extends MediaWikiTestCase { public function testGetPageUrl( $path, $page, $expected ) { $site = new Site(); - //NOTE: the assumption that getPageUrl is based on getLinkPath + // NOTE: the assumption that getPageUrl is based on getLinkPath // is true for Site but not guaranteed for subclasses. // Subclasses need to override this test case appropriately. $site->setLinkPath( $path ); diff --git a/tests/phpunit/includes/site/TestSites.php b/tests/phpunit/includes/site/TestSites.php index 4c402484cb..ac51183992 100644 --- a/tests/phpunit/includes/site/TestSites.php +++ b/tests/phpunit/includes/site/TestSites.php @@ -79,7 +79,7 @@ class TestSites { $languageCodes = array( 'de', 'en', - 'fa', //right-to-left + 'fa', // right-to-left 'nl', 'nn', 'no', diff --git a/tests/phpunit/includes/specials/SpecialRecentchangesTest.php b/tests/phpunit/includes/specials/SpecialRecentchangesTest.php index c3d75aa58c..0a6336f1de 100644 --- a/tests/phpunit/includes/specials/SpecialRecentchangesTest.php +++ b/tests/phpunit/includes/specials/SpecialRecentchangesTest.php @@ -26,7 +26,7 @@ class SpecialRecentchangesTest extends MediaWikiTestCase { $this->rc->setContext( $context ); $formOptions = $this->rc->setup( null ); - # Filter out rc_timestamp conditions which depends on the test runtime + #  Filter out rc_timestamp conditions which depends on the test runtime # This condition is not needed as of march 2, 2011 -- hashar # @todo FIXME: Find a way to generate the correct rc_timestamp $queryConditions = array_filter( diff --git a/tests/phpunit/includes/title/MediaWikiPageLinkRendererTest.php b/tests/phpunit/includes/title/MediaWikiPageLinkRendererTest.php index 1e5f9d0150..6cfddf01e2 100644 --- a/tests/phpunit/includes/title/MediaWikiPageLinkRendererTest.php +++ b/tests/phpunit/includes/title/MediaWikiPageLinkRendererTest.php @@ -93,15 +93,15 @@ class MediaWikiPageLinkRendererTest extends MediaWikiTestCase { '!Foo Bar!' ), array( - //NOTE: Linker doesn't include fragments in "broken" links - //NOTE: once this no longer uses Linker, we will get "2" instead of "User" for the namespace. + // NOTE: Linker doesn't include fragments in "broken" links + // NOTE: once this no longer uses Linker, we will get "2" instead of "User" for the namespace. new TitleValue( NS_USER, 'Hansi_Maier', 'stuff' ), 'Hansi Maier\'s Stuff', '!assertEquals( 'абвг', $this->convertToCyrillic( 'abvg' ) ); - //Same as above, but assert that -{}-s must be removed and not converted + // Same as above, but assert that -{}-s must be removed and not converted $this->assertEquals( 'ljабnjвгdž', $this->convertToCyrillic( '-{lj}-ab-{nj}-vg-{dž}-' ) ); - //A simple convertion of Cyrillic to Cyrillic + // A simple convertion of Cyrillic to Cyrillic $this->assertEquals( 'абвг', $this->convertToCyrillic( 'абвг' ) ); - //Same as above, but assert that -{}-s must be removed and not converted + // Same as above, but assert that -{}-s must be removed and not converted $this->assertEquals( 'ljабnjвгdž', $this->convertToCyrillic( '-{lj}-аб-{nj}-вг-{dž}-' ) ); - //This text has some Latin, but is recognized as Cyrillic, so it should not be converted + // This text has some Latin, but is recognized as Cyrillic, so it should not be converted $this->assertEquals( 'abvgшђжчћ', $this->convertToCyrillic( 'abvgшђжчћ' ) ); - //Same as above, but assert that -{}-s must be removed + // Same as above, but assert that -{}-s must be removed $this->assertEquals( 'љabvgњшђжчћџ', $this->convertToCyrillic( '-{љ}-abvg-{њ}-шђжчћ-{џ}-' ) ); - //This text has some Cyrillic, but is recognized as Latin, so it should be converted + // This text has some Cyrillic, but is recognized as Latin, so it should be converted $this->assertEquals( 'абвгшђжчћ', $this->convertToCyrillic( 'абвгšđžčć' ) ); - //Same as above, but assert that -{}-s must be removed and not converted + // Same as above, but assert that -{}-s must be removed and not converted $this->assertEquals( 'ljабвгnjшђжчћdž', $this->convertToCyrillic( '-{lj}-абвг-{nj}-šđžčć-{dž}-' ) ); @@ -107,19 +107,19 @@ class LanguageSrTest extends LanguageClassesTestCase { * @covers LanguageConverter::convertTo */ public function testConversionToLatin() { - //A simple convertion of Latin to Latin + // A simple convertion of Latin to Latin $this->assertEquals( 'abcd', $this->convertToLatin( 'abcd' ) ); - //A simple convertion of Cyrillic to Latin + // A simple convertion of Cyrillic to Latin $this->assertEquals( 'abcd', $this->convertToLatin( 'абцд' ) ); - //This text has some Latin, but is recognized as Cyrillic, so it should be converted + // This text has some Latin, but is recognized as Cyrillic, so it should be converted $this->assertEquals( 'abcdšđžčć', $this->convertToLatin( 'abcdшђжчћ' ) ); - //This text has some Cyrillic, but is recognized as Latin, so it should not be converted + // This text has some Cyrillic, but is recognized as Latin, so it should not be converted $this->assertEquals( 'абцдšđžčć', $this->convertToLatin( 'абцдšđžčć' ) ); @@ -177,7 +177,7 @@ class LanguageSrTest extends LanguageClassesTestCase { ); } - ##### HELPERS ##################################################### + # #### HELPERS ##################################################### /** *Wrapper to verify text stay the same after applying conversion * @param string $text Text to convert diff --git a/tests/phpunit/languages/classes/LanguageUzTest.php b/tests/phpunit/languages/classes/LanguageUzTest.php index 4881103ffb..7ef87bf460 100644 --- a/tests/phpunit/languages/classes/LanguageUzTest.php +++ b/tests/phpunit/languages/classes/LanguageUzTest.php @@ -56,7 +56,7 @@ class LanguageUzTest extends LanguageClassesTestCase { ); } - ##### HELPERS ##################################################### + # #### HELPERS ##################################################### /** * Wrapper to verify text stay the same after applying conversion * @param string $text Text to convert diff --git a/tests/phpunit/phpunit.php b/tests/phpunit/phpunit.php index 5591aa12cc..49b91c3808 100755 --- a/tests/phpunit/phpunit.php +++ b/tests/phpunit/phpunit.php @@ -128,7 +128,7 @@ class PHPUnitMaintClass extends Maintenance { # Make sure we have --configuration or PHPUnit might complain if ( !in_array( '--configuration', $_SERVER['argv'] ) ) { - //Hack to eliminate the need to use the Makefile (which sucks ATM) + // Hack to eliminate the need to use the Makefile (which sucks ATM) array_splice( $_SERVER['argv'], 1, 0, array( '--configuration', $IP . '/tests/phpunit/suite.xml' ) ); } diff --git a/thumb.php b/thumb.php index 738fa3861a..bd14e417a6 100644 --- a/thumb.php +++ b/thumb.php @@ -38,7 +38,7 @@ if ( defined( 'THUMB_HANDLER' ) ) { $mediawiki = new MediaWiki(); $mediawiki->doPostOutputShutdown( 'fast' ); -//-------------------------------------------------------------------------- +// -------------------------------------------------------------------------- /** * Handle a thumbnail request via thumbnail file URL -- 2.20.1