From 977c8103024734daed49acd40499883bf419ff0d Mon Sep 17 00:00:00 2001 From: umherirrender Date: Wed, 14 Oct 2015 09:46:44 +0200 Subject: [PATCH] Remove empty line comments Remove empty line comments as found by the MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.EmptyComment sniff Change-Id: I5d694f7a7d3bc97e16300ba03c60ad17f3c912a5 --- includes/Html.php | 1 - includes/HtmlFormatter.php | 7 ++----- includes/Linker.php | 1 - includes/MediaWiki.php | 5 ++--- includes/User.php | 2 +- includes/libs/IEUrlExtension.php | 1 - includes/upload/UploadBase.php | 2 +- includes/upload/UploadStash.php | 1 - languages/classes/LanguageHy.php | 4 ++-- languages/classes/LanguageWa.php | 2 -- tests/phpunit/MediaWikiTestCase.php | 1 - tests/phpunit/includes/LinkFilterTest.php | 7 ------- tests/phpunit/maintenance/DumpTestCase.php | 2 +- tests/phpunit/maintenance/MaintenanceTest.php | 1 - tests/phpunit/maintenance/backupTextPassTest.php | 1 - 15 files changed, 9 insertions(+), 29 deletions(-) diff --git a/includes/Html.php b/includes/Html.php index c61dca8a08..506b9cc3bf 100644 --- a/includes/Html.php +++ b/includes/Html.php @@ -597,7 +597,6 @@ class Html { // we may as well not call htmlspecialchars(). // @todo FIXME: Verify that we actually need to // escape \n\r\t here, and explain why, exactly. - # // We could call Sanitizer::encodeAttribute() for this, but we // don't because we're stubborn and like our marginal savings on // byte size from not having to encode unnecessary quotes. diff --git a/includes/HtmlFormatter.php b/includes/HtmlFormatter.php index 83db268e84..2d81b28242 100644 --- a/includes/HtmlFormatter.php +++ b/includes/HtmlFormatter.php @@ -74,10 +74,8 @@ class HtmlFormatter { } // Workaround for bug that caused spaces before references - // to disappear during processing: - // https://phabricator.wikimedia.org/T55086 - // - // Please replace with a better fix if one can be found. + // to disappear during processing: https://phabricator.wikimedia.org/T55086 + // TODO: Please replace with a better fix if one can be found. $html = str_replace( ' <', ' <', $html ); libxml_use_internal_errors( true ); @@ -295,7 +293,6 @@ class HtmlFormatter { $html = $this->fixLibXml( $html ); if ( wfIsWindows() ) { // Cleanup for CRLF misprocessing of unknown origin on Windows. - // // If this error continues in the future, please track it down in the // XML code paths if possible and fix there. $html = str_replace( ' ', '', $html ); diff --git a/includes/Linker.php b/includes/Linker.php index 2e33bd199c..e821004f41 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -623,7 +623,6 @@ class Linker { # Create a thumbnail. Alignment depends on the writing direction of # the page content language (right-aligned for LTR languages, # left-aligned for RTL languages) - # # If a thumbnail width has not been provided, it is set # to the default user option as specified in Language*.php if ( $fp['align'] == '' ) { diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index aee6ee1b99..3399790c20 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -203,10 +203,9 @@ class MediaWiki { // curid and oldid request parameters would allow page titles to be enumerated even // when they are not guessable. So we reset the title to Special:Badtitle before the // permissions error is displayed. - // + // The skin mostly uses $this->context->getTitle() these days, but some extensions // still use $wgTitle. - $badTitle = SpecialPage::getTitleFor( 'Badtitle' ); $this->context->setTitle( $badTitle ); $wgTitle = $badTitle; @@ -628,7 +627,7 @@ class MediaWiki { // redirecting to HTTPS. It's likely such a request is going // to fail due to post data being lost, but let's try anyway // and just log the instance. - // + // @todo FIXME: See if we could issue a 307 or 308 here, need // to see how clients (automated & browser) behave when we do wfDebugLog( 'RedirectedPosts', "Redirected from HTTP to HTTPS: $oldUrl" ); diff --git a/includes/User.php b/includes/User.php index 75649a7881..5017685a32 100644 --- a/includes/User.php +++ b/includes/User.php @@ -5209,7 +5209,7 @@ class User implements IDBAccessObject { # Note that the pattern requirement will always be satisfied if the # input is empty, so we need required in all cases. - # + # @todo FIXME: Bug 23769: This needs to not claim the password is required # if e-mail confirmation is being used. Since HTML5 input validation # is b0rked anyway in some browsers, just return nothing. When it's diff --git a/includes/libs/IEUrlExtension.php b/includes/libs/IEUrlExtension.php index 49d05d4b72..216d9b7860 100644 --- a/includes/libs/IEUrlExtension.php +++ b/includes/libs/IEUrlExtension.php @@ -119,7 +119,6 @@ class IEUrlExtension { if ( !preg_match( '/^[a-zA-Z0-9_-]+$/', $extension ) ) { // Non-alphanumeric extension, unlikely to be registered. - // // The regex above is known to match all registered file extensions // in a default Windows XP installation. It's important to allow // extensions with ampersands and percent signs, since that reduces diff --git a/includes/upload/UploadBase.php b/includes/upload/UploadBase.php index 8514187ea6..5f4a16aa44 100644 --- a/includes/upload/UploadBase.php +++ b/includes/upload/UploadBase.php @@ -1763,7 +1763,7 @@ abstract class UploadBase { // We're not using the normalized form of the extension. // Normal form is lowercase, using most common of alternate // extensions (eg 'jpg' rather than 'JPEG'). - // + // Check for another file using the normalized form... $nt_lc = Title::makeTitle( NS_FILE, "{$partname}.{$normalizedExtension}" ); $file_lc = wfLocalFile( $nt_lc ); diff --git a/includes/upload/UploadStash.php b/includes/upload/UploadStash.php index b9a1bbf14f..b971c00f35 100644 --- a/includes/upload/UploadStash.php +++ b/includes/upload/UploadStash.php @@ -221,7 +221,6 @@ class UploadStash { // If no key was supplied, make one. a mysql insertid would be totally // reasonable here, except that for historical reasons, the key is this // random thing instead. At least it's not guessable. - // // Some things that when combined will make a suitably unique key. // see: http://www.jwz.org/doc/mid.html list( $usec, $sec ) = explode( ' ', microtime() ); diff --git a/languages/classes/LanguageHy.php b/languages/classes/LanguageHy.php index b7767eb3a6..7cedcc523c 100644 --- a/languages/classes/LanguageHy.php +++ b/languages/classes/LanguageHy.php @@ -68,10 +68,10 @@ class LanguageHy extends Language { case 'accusative': # Հայցական հոլով # stub break; - case 'instrumental': # + case 'instrumental': # stub break; - case 'prepositional': # + case 'prepositional': # stub break; } diff --git a/languages/classes/LanguageWa.php b/languages/classes/LanguageWa.php index 98d138dbf1..3520298e62 100644 --- a/languages/classes/LanguageWa.php +++ b/languages/classes/LanguageWa.php @@ -50,7 +50,6 @@ class LanguageWa extends Language { $datePreference = $this->dateFormat( $format ); # ISO (YYYY-mm-dd) format - # # we also output this format for YMD (eg: 2001 January 15) if ( $datePreference == 'ISO 8601' ) { $d = substr( $ts, 0, 4 ) . '-' . substr( $ts, 4, 2 ) . '-' . substr( $ts, 6, 2 ); @@ -64,7 +63,6 @@ class LanguageWa extends Language { } # Walloon format - # # we output this in all other cases $m = substr( $ts, 4, 2 ); $n = substr( $ts, 6, 2 ); diff --git a/tests/phpunit/MediaWikiTestCase.php b/tests/phpunit/MediaWikiTestCase.php index 9bbbf9f985..ab4652c0ee 100644 --- a/tests/phpunit/MediaWikiTestCase.php +++ b/tests/phpunit/MediaWikiTestCase.php @@ -181,7 +181,6 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { $fileName = $this->getNewTempFile(); // Converting the temporary /file/ to a /directory/ - // // The following is not atomic, but at least we now have a single place, // where temporary directory creation is bundled and can be improved unlink( $fileName ); diff --git a/tests/phpunit/includes/LinkFilterTest.php b/tests/phpunit/includes/LinkFilterTest.php index f011f47ccb..9093564fde 100644 --- a/tests/phpunit/includes/LinkFilterTest.php +++ b/tests/phpunit/includes/LinkFilterTest.php @@ -125,21 +125,16 @@ class LinkFilterTest extends MediaWikiLangTestCase { array( '', 'gopher://*.test.com/', 'gopher://gopher.test.com/0/v2/vstat' ), array( 'telnet://', '*.test.com', 'telnet://shell.test.com/~home/' ), - // // The following only work in PHP >= 5.3.7, due to a bug in parse_url which eats // the path from the url (https://bugs.php.net/bug.php?id=54180) - // // array( '', 'http://test.com', 'http://test.com/index?arg=1' ), // array( 'http://', '*.test.com', 'http://www.test.com/index?arg=1' ), // array( '' , // 'http://xx23124:__ffdfdef__@www.test.com:12345/dir' , // 'http://name:pass@www.test.com:12345/dir/dir/file.xyz.php#__se__?arg1=_&arg2[]=4rtg' // ), - // - // // Tests for false positives - // array( 'http://', 'test.com', 'http://www.test.com', false ), array( 'http://', 'www1.test.com', 'http://www.test.com', false ), array( 'http://', '*.test.com', 'http://www.test.t.com', false ), @@ -166,10 +161,8 @@ class LinkFilterTest extends MediaWikiLangTestCase { array( '', 'http://test.com:8080/dir/', 'http://test.com:808/dir/', false ), array( '', 'http://test.com/dir/index.html', 'http://test.com/dir/index.php', false ), - // // These are false positives too and ideally shouldn't match, but that // would require using regexes and RLIKE instead of LIKE - // // 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 ), diff --git a/tests/phpunit/maintenance/DumpTestCase.php b/tests/phpunit/maintenance/DumpTestCase.php index 8c76397053..c846c0677d 100644 --- a/tests/phpunit/maintenance/DumpTestCase.php +++ b/tests/phpunit/maintenance/DumpTestCase.php @@ -102,7 +102,7 @@ abstract class DumpTestCase extends MediaWikiLangTestCase { // expectOutput[...] functions. However, the PHPUnit shipped prediactes // do not allow to check /each/ line of the output using /readable/ REs. // So we ... - // + // 1. ... add a dummy output checking to make PHPUnit not complain // about unchecked test output $this->expectOutputRegex( '//' ); diff --git a/tests/phpunit/maintenance/MaintenanceTest.php b/tests/phpunit/maintenance/MaintenanceTest.php index 454e9c15e6..5c6a6cde85 100644 --- a/tests/phpunit/maintenance/MaintenanceTest.php +++ b/tests/phpunit/maintenance/MaintenanceTest.php @@ -4,7 +4,6 @@ // instead of the MaintenanceFixup hack below. However, we cannot do // without changing the visibility and without working around hacks in // Maintenance.php -// // For the same reason, we cannot just use FakeMaintenance. /** diff --git a/tests/phpunit/maintenance/backupTextPassTest.php b/tests/phpunit/maintenance/backupTextPassTest.php index c216864ec4..f5dd98b3fb 100644 --- a/tests/phpunit/maintenance/backupTextPassTest.php +++ b/tests/phpunit/maintenance/backupTextPassTest.php @@ -301,7 +301,6 @@ class TextPassDumperDatabaseTest extends DumpTestCase { // The dump (hopefully) did take long enough to produce more than one // checkpoint file. - // // We now check all the checkpoint files for validity. $files = scandir( $nameOutputDir ); -- 2.20.1