From 34fe90ac52644c3a543ca8adf89900c0fb2de70b Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sat, 5 Nov 2016 11:55:10 +0100 Subject: [PATCH] Remove empty lines at end of functions It looks like there is something missing after the last statement Also remove some other empty lines at begin of functions, ifs or loops while at these files Change-Id: Ib00b5cfd31ca4dcd0c32ce33754d3c80bae70641 --- includes/AjaxDispatcher.php | 2 -- includes/EditPage.php | 4 ---- includes/Feed.php | 1 - includes/MediaWikiServices.php | 1 - includes/OutputPage.php | 1 - includes/Preferences.php | 2 -- includes/Title.php | 3 --- includes/Xml.php | 1 - includes/actions/HistoryAction.php | 1 - includes/api/ApiQuerySiteinfo.php | 1 - includes/cache/UserCache.php | 2 -- includes/cache/localisation/LocalisationCache.php | 3 --- includes/deferred/SearchUpdate.php | 1 - includes/diff/WordLevelDiff.php | 3 --- includes/filerepo/file/OldLocalFile.php | 3 --- .../htmlform/fields/HTMLSelectAndOtherField.php | 1 - includes/htmlform/fields/HTMLSelectNamespace.php | 1 - includes/htmlform/fields/HTMLSelectOrOtherField.php | 1 - includes/http/MWHttpRequest.php | 6 ------ includes/installer/DatabaseInstaller.php | 1 - includes/libs/CSSMin.php | 1 - includes/libs/filebackend/SwiftFileBackend.php | 1 - includes/libs/mime/XmlTypeCheck.php | 3 --- .../libs/virtualrest/ParsoidVirtualRESTService.php | 3 --- .../libs/virtualrest/RestbaseVirtualRESTService.php | 6 ------ includes/media/FormatMetadata.php | 4 ---- includes/page/ImagePage.php | 1 - includes/parser/LinkHolderArray.php | 4 ---- includes/parser/ParserOptions.php | 1 - includes/resourceloader/ResourceLoader.php | 4 ---- includes/search/SearchPostgres.php | 2 -- includes/skins/BaseTemplate.php | 1 - includes/skins/SkinTemplate.php | 3 --- includes/specialpage/LoginSignupSpecialPage.php | 1 - includes/specials/SpecialSearch.php | 4 ---- includes/user/User.php | 2 -- languages/classes/LanguageSr.php | 1 - languages/classes/LanguageZh.php | 2 -- maintenance/Maintenance.php | 2 -- maintenance/checkComposerLockUpToDate.php | 1 - maintenance/createCommonPasswordCdb.php | 1 - tests/parser/TestFileReader.php | 1 - tests/phpunit/includes/GitInfoTest.php | 1 - tests/phpunit/includes/HtmlTest.php | 2 -- tests/phpunit/includes/LinkFilterTest.php | 13 ------------- tests/phpunit/includes/PagePropsTest.php | 4 ---- tests/phpunit/includes/TemplateCategoriesTest.php | 1 - .../includes/api/ApiContinuationManagerTest.php | 1 - tests/phpunit/includes/api/ApiResultTest.php | 2 -- .../phpunit/includes/api/ApiRevisionDeleteTest.php | 1 - tests/phpunit/includes/auth/AuthManagerTest.php | 2 -- ...ificationSecondaryAuthenticationProviderTest.php | 1 - ...calPasswordPrimaryAuthenticationProviderTest.php | 2 -- ...aryPasswordPrimaryAuthenticationProviderTest.php | 1 - .../auth/UserDataAuthenticationRequestTest.php | 1 - .../phpunit/includes/exception/MWExceptionTest.php | 2 -- tests/phpunit/includes/linker/LinkRendererTest.php | 1 - tests/phpunit/includes/media/ExifBitmapTest.php | 1 - .../includes/session/SessionProviderTest.php | 1 - tests/phpunit/includes/session/SessionTest.php | 1 - tests/phpunit/includes/user/UserTest.php | 2 -- 61 files changed, 128 deletions(-) diff --git a/includes/AjaxDispatcher.php b/includes/AjaxDispatcher.php index 91422385a2..d444a2791f 100644 --- a/includes/AjaxDispatcher.php +++ b/includes/AjaxDispatcher.php @@ -90,7 +90,6 @@ class AjaxDispatcher { # Or we could throw an exception: # throw new MWException( __METHOD__ . ' called without any data (mode empty).' ); } - } /** @@ -156,6 +155,5 @@ class AjaxDispatcher { } } } - } } diff --git a/includes/EditPage.php b/includes/EditPage.php index 7dd68e4448..9c5c91ab55 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1044,7 +1044,6 @@ class EditPage { // Allow extensions to modify form data Hooks::run( 'EditPage::importFormData', [ $this, $request ] ); - } /** @@ -2237,7 +2236,6 @@ class EditPage { * @return bool */ private function mergeChangesIntoContent( &$editContent ) { - $db = wfGetDB( DB_MASTER ); // This is the revision the editor started from @@ -2813,7 +2811,6 @@ class EditPage { if ( !$wgUser->getOption( 'previewontop' ) ) { $this->displayPreviewArea( $previewOutput, false ); } - } /** @@ -2839,7 +2836,6 @@ class EditPage { return Html::rawElement( 'div', [ 'class' => 'templatesUsed' ], $templateListFormatter->format( $templates, $type ) ); - } /** diff --git a/includes/Feed.php b/includes/Feed.php index 8bfe1c7ef9..189fd9f2fb 100644 --- a/includes/Feed.php +++ b/includes/Feed.php @@ -236,7 +236,6 @@ abstract class ChannelFeed extends FeedItem { $wgOut->addVaryHeader( 'X-Forwarded-Proto' ); } $wgOut->sendCacheControl(); - } /** diff --git a/includes/MediaWikiServices.php b/includes/MediaWikiServices.php index bb2ed5bf87..a0c00c6c07 100644 --- a/includes/MediaWikiServices.php +++ b/includes/MediaWikiServices.php @@ -192,7 +192,6 @@ class MediaWikiServices extends ServiceContainer { } else { $oldInstance->destroy(); } - } /** diff --git a/includes/OutputPage.php b/includes/OutputPage.php index bf59c9a5d2..07b7029582 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -1713,7 +1713,6 @@ class OutputPage extends ContextSource { $popts->setTidy( $oldTidy ); $this->addParserOutput( $parserOutput ); - } /** diff --git a/includes/Preferences.php b/includes/Preferences.php index 9f8c06b9bf..d86b19a5ce 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -861,7 +861,6 @@ class Preferences { 'section' => 'editing/preview', 'label-message' => 'tog-uselivepreview', ]; - } /** @@ -1614,7 +1613,6 @@ class PreferencesForm extends HTMLForm { * @return string */ function getButtons() { - $attrs = [ 'id' => 'mw-prefs-restoreprefs' ]; if ( !$this->getModifiedUser()->isAllowedAny( 'editmyprivateinfo', 'editmyoptions' ) ) { diff --git a/includes/Title.php b/includes/Title.php index 213572b95b..3c51baebe2 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1412,7 +1412,6 @@ class Title implements LinkTarget { $fragment, $this->getInterwiki() ); - } /** @@ -2926,7 +2925,6 @@ class Title implements LinkTarget { # Cycle through all the restrictions. foreach ( $rows as $row ) { - // Don't take care of restrictions types that aren't allowed if ( !in_array( $row->pr_type, $restrictionTypes ) ) { continue; @@ -4600,7 +4598,6 @@ class Title implements LinkTarget { : $wgExemptFromUserRobotsControl; return !in_array( $this->mNamespace, $bannedNamespaces ); - } /** diff --git a/includes/Xml.php b/includes/Xml.php index b1bd098327..4c6b0715b0 100644 --- a/includes/Xml.php +++ b/includes/Xml.php @@ -238,7 +238,6 @@ class Xml { Xml::label( $msg->text(), $attrs['id'] ), Xml::tags( 'select', $attrs, $options ) ]; - } /** diff --git a/includes/actions/HistoryAction.php b/includes/actions/HistoryAction.php index 1e1bb39aec..c1763fa1be 100644 --- a/includes/actions/HistoryAction.php +++ b/includes/actions/HistoryAction.php @@ -218,7 +218,6 @@ class HistoryAction extends FormlessAction { $pager->getNavigationBar() ); $out->preventClickjacking( $pager->getPreventClickjacking() ); - } /** diff --git a/includes/api/ApiQuerySiteinfo.php b/includes/api/ApiQuerySiteinfo.php index 99f722da9b..0bb7ff8ef1 100644 --- a/includes/api/ApiQuerySiteinfo.php +++ b/includes/api/ApiQuerySiteinfo.php @@ -576,7 +576,6 @@ class ApiQuerySiteinfo extends ApiQueryBase { ApiResult::setIndexedTagName( $data, 'library' ); return $this->getResult()->addValue( 'query', $property, $data ); - } protected function appendExtensions( $property ) { diff --git a/includes/cache/UserCache.php b/includes/cache/UserCache.php index 016306aff8..5c75292628 100644 --- a/includes/cache/UserCache.php +++ b/includes/cache/UserCache.php @@ -80,7 +80,6 @@ class UserCache { * @param string $caller The calling method */ public function doQuery( array $userIds, $options = [], $caller = '' ) { - $usersToCheck = []; $usersToQuery = []; @@ -132,7 +131,6 @@ class UserCache { } } $lb->execute(); - } /** diff --git a/includes/cache/localisation/LocalisationCache.php b/includes/cache/localisation/LocalisationCache.php index 4970a2bb5f..4b6362fb0b 100644 --- a/includes/cache/localisation/LocalisationCache.php +++ b/includes/cache/localisation/LocalisationCache.php @@ -549,7 +549,6 @@ class LocalisationCache { * @return array Array with a 'messages' key, or empty array if the file doesn't exist */ public function readJSONFile( $fileName ) { - if ( !is_readable( $fileName ) ) { return []; } @@ -561,7 +560,6 @@ class LocalisationCache { $data = FormatJson::decode( $json, true ); if ( $data === null ) { - throw new MWException( __METHOD__ . ": Invalid JSON file: $fileName" ); } @@ -1036,7 +1034,6 @@ class LocalisationCache { $blobStore = new MessageBlobStore(); $blobStore->clear(); } - } /** diff --git a/includes/deferred/SearchUpdate.php b/includes/deferred/SearchUpdate.php index 62c8b00f39..b9a259b1a4 100644 --- a/includes/deferred/SearchUpdate.php +++ b/includes/deferred/SearchUpdate.php @@ -108,7 +108,6 @@ class SearchUpdate implements DeferrableUpdate { # Perform the actual update $search->update( $this->id, $normalTitle, $search->normalizeText( $text ) ); } - } /** diff --git a/includes/diff/WordLevelDiff.php b/includes/diff/WordLevelDiff.php index 296e3b7493..9c9b1c9c57 100644 --- a/includes/diff/WordLevelDiff.php +++ b/includes/diff/WordLevelDiff.php @@ -42,7 +42,6 @@ class WordLevelDiff extends \Diff { * @param string[] $linesAfter */ public function __construct( $linesBefore, $linesAfter ) { - list( $wordsBefore, $wordsBeforeStripped ) = $this->split( $linesBefore ); list( $wordsAfter, $wordsAfterStripped ) = $this->split( $linesAfter ); @@ -68,7 +67,6 @@ class WordLevelDiff extends \Diff { $yi += count( $closing ); } } - } /** @@ -77,7 +75,6 @@ class WordLevelDiff extends \Diff { * @return array[] */ private function split( $lines ) { - $words = []; $stripped = []; $first = true; diff --git a/includes/filerepo/file/OldLocalFile.php b/includes/filerepo/file/OldLocalFile.php index a17ca6e25a..06fef4f6f0 100644 --- a/includes/filerepo/file/OldLocalFile.php +++ b/includes/filerepo/file/OldLocalFile.php @@ -194,14 +194,12 @@ class OldLocalFile extends LocalFile { } else { $this->fileExists = false; } - } /** * Load lazy file metadata from the DB */ protected function loadExtraFromDB() { - $this->extraDataLoaded = true; $dbr = $this->repo->getSlaveDB(); $conds = [ 'oi_name' => $this->getName() ]; @@ -227,7 +225,6 @@ class OldLocalFile extends LocalFile { } else { throw new MWException( "Could not find data for image '{$this->archive_name}'." ); } - } /** diff --git a/includes/htmlform/fields/HTMLSelectAndOtherField.php b/includes/htmlform/fields/HTMLSelectAndOtherField.php index 363769da2b..86e8e75655 100644 --- a/includes/htmlform/fields/HTMLSelectAndOtherField.php +++ b/includes/htmlform/fields/HTMLSelectAndOtherField.php @@ -31,7 +31,6 @@ class HTMLSelectAndOtherField extends HTMLSelectField { $this->mOptions = [ $params['other'] => 'other' ] + $this->mOptions; } $this->mFlatOptions = self::flattenOptions( $this->getOptions() ); - } public function getInputHTML( $value ) { diff --git a/includes/htmlform/fields/HTMLSelectNamespace.php b/includes/htmlform/fields/HTMLSelectNamespace.php index 2e07af6b70..f13aa1777c 100644 --- a/includes/htmlform/fields/HTMLSelectNamespace.php +++ b/includes/htmlform/fields/HTMLSelectNamespace.php @@ -9,7 +9,6 @@ class HTMLSelectNamespace extends HTMLFormField { $this->mAllValue = array_key_exists( 'all', $params ) ? $params['all'] : 'all'; - } public function getInputHTML( $value ) { diff --git a/includes/htmlform/fields/HTMLSelectOrOtherField.php b/includes/htmlform/fields/HTMLSelectOrOtherField.php index 1afb0a98d1..bb410799ef 100644 --- a/includes/htmlform/fields/HTMLSelectOrOtherField.php +++ b/includes/htmlform/fields/HTMLSelectOrOtherField.php @@ -18,7 +18,6 @@ class HTMLSelectOrOtherField extends HTMLTextField { // Have 'other' always as first element $this->mOptions = [ $msg => 'other' ] + $this->mOptions; } - } public function getInputHTML( $value ) { diff --git a/includes/http/MWHttpRequest.php b/includes/http/MWHttpRequest.php index 458854ab2d..08883ae44f 100644 --- a/includes/http/MWHttpRequest.php +++ b/includes/http/MWHttpRequest.php @@ -362,7 +362,6 @@ class MWHttpRequest implements LoggerAwareInterface { * @return Status */ public function execute() { - $this->content = ""; if ( strtoupper( $this->method ) == "HEAD" ) { @@ -378,7 +377,6 @@ class MWHttpRequest implements LoggerAwareInterface { if ( !isset( $this->reqHeaders['User-Agent'] ) ) { $this->setUserAgent( Http::userAgent() ); } - } /** @@ -387,7 +385,6 @@ class MWHttpRequest implements LoggerAwareInterface { * found in an array in the member variable headerList. */ protected function parseHeader() { - $lastname = ""; foreach ( $this->headerList as $header ) { @@ -404,7 +401,6 @@ class MWHttpRequest implements LoggerAwareInterface { } $this->parseCookies(); - } /** @@ -538,7 +534,6 @@ class MWHttpRequest implements LoggerAwareInterface { * Parse the cookies in the response headers and store them in the cookie jar. */ protected function parseCookies() { - if ( !$this->cookieJar ) { $this->cookieJar = new CookieJar; } @@ -549,7 +544,6 @@ class MWHttpRequest implements LoggerAwareInterface { $this->cookieJar->parseCookieResponseHeader( $cookie, $url['host'] ); } } - } /** diff --git a/includes/installer/DatabaseInstaller.php b/includes/installer/DatabaseInstaller.php index 331d1a1bd5..50d73de4c8 100644 --- a/includes/installer/DatabaseInstaller.php +++ b/includes/installer/DatabaseInstaller.php @@ -336,7 +336,6 @@ abstract class DatabaseInstaller { $services->redefineService( 'DBLoadBalancerFactory', function() use ( $connection ) { return LBFactorySingle::newFromConnection( $connection ); } ); - } /** diff --git a/includes/libs/CSSMin.php b/includes/libs/CSSMin.php index 797a438d00..bc99672f36 100644 --- a/includes/libs/CSSMin.php +++ b/includes/libs/CSSMin.php @@ -357,7 +357,6 @@ class CSSMin { }, $source ); return $source; - } /** diff --git a/includes/libs/filebackend/SwiftFileBackend.php b/includes/libs/filebackend/SwiftFileBackend.php index 4bc0ce69dc..1593457f43 100644 --- a/includes/libs/filebackend/SwiftFileBackend.php +++ b/includes/libs/filebackend/SwiftFileBackend.php @@ -176,7 +176,6 @@ class SwiftFileBackend extends FileBackendStore { return isset( $params['headers'] ) ? $this->getCustomHeaders( $params['headers'] ) : []; - } /** diff --git a/includes/libs/mime/XmlTypeCheck.php b/includes/libs/mime/XmlTypeCheck.php index f057140a6b..3958f8c00b 100644 --- a/includes/libs/mime/XmlTypeCheck.php +++ b/includes/libs/mime/XmlTypeCheck.php @@ -175,7 +175,6 @@ class XmlTypeCheck { } private function validate( $reader ) { - // First, move through anything that isn't an element, and // handle any processing instructions with the callback do { @@ -240,7 +239,6 @@ class XmlTypeCheck { // NOTATION, or XML_DECLARATION // xml_parse didn't send these to the filter, so we won't. } - } while ( $this->readNext( $reader ) ); if ( $this->stackDepth !== 0 ) { @@ -248,7 +246,6 @@ class XmlTypeCheck { } elseif ( $this->wellFormed === null ) { $this->wellFormed = true; } - } /** diff --git a/includes/libs/virtualrest/ParsoidVirtualRESTService.php b/includes/libs/virtualrest/ParsoidVirtualRESTService.php index da47d35651..a148a39707 100644 --- a/includes/libs/virtualrest/ParsoidVirtualRESTService.php +++ b/includes/libs/virtualrest/ParsoidVirtualRESTService.php @@ -103,7 +103,6 @@ class ParsoidVirtualRESTService extends VirtualRESTService { continue; } if ( $targetWiki !== 'local' ) { - throw new Exception( "Only 'local' target wiki is currently supported" ); } if ( $reqType !== 'page' && $reqType !== 'transform' ) { @@ -150,7 +149,6 @@ class ParsoidVirtualRESTService extends VirtualRESTService { * API. We now translate these to the "real" Parsoid v3 API. */ public function onParsoid1Request( array $req, Closure $idGeneratorFunc ) { - $parts = explode( '/', $req['url'] ); list( $targetWiki, // 'local' @@ -221,7 +219,6 @@ class ParsoidVirtualRESTService extends VirtualRESTService { } return $req; - } } diff --git a/includes/libs/virtualrest/RestbaseVirtualRESTService.php b/includes/libs/virtualrest/RestbaseVirtualRESTService.php index 3afbaa36da..35c45deb50 100644 --- a/includes/libs/virtualrest/RestbaseVirtualRESTService.php +++ b/includes/libs/virtualrest/RestbaseVirtualRESTService.php @@ -78,7 +78,6 @@ class RestbaseVirtualRESTService extends VirtualRESTService { } public function onRequests( array $reqs, Closure $idGenFunc ) { - if ( $this->params['parsoidCompat'] ) { return $this->onParsoidRequests( $reqs, $idGenFunc ); } @@ -117,7 +116,6 @@ class RestbaseVirtualRESTService extends VirtualRESTService { * Remaps Parsoid v1/v3 requests to RESTBase v1 requests. */ public function onParsoidRequests( array $reqs, Closure $idGeneratorFunc ) { - $result = []; foreach ( $reqs as $key => $req ) { $version = explode( '/', $req['url'] )[1]; @@ -131,7 +129,6 @@ class RestbaseVirtualRESTService extends VirtualRESTService { } return $result; - } /** @@ -223,7 +220,6 @@ class RestbaseVirtualRESTService extends VirtualRESTService { } return $req; - } /** @@ -241,7 +237,6 @@ class RestbaseVirtualRESTService extends VirtualRESTService { * * $revision is optional */ public function onParsoid3Request( array $req, Closure $idGeneratorFunc ) { - $parts = explode( '/', $req['url'] ); list( $targetWiki, // 'local' @@ -272,7 +267,6 @@ class RestbaseVirtualRESTService extends VirtualRESTService { } return $req; - } } diff --git a/includes/media/FormatMetadata.php b/includes/media/FormatMetadata.php index fffc262ede..51a0135859 100644 --- a/includes/media/FormatMetadata.php +++ b/includes/media/FormatMetadata.php @@ -102,7 +102,6 @@ class FormatMetadata extends ContextSource { unset( $tags['ResolutionUnit'] ); foreach ( $tags as $tag => &$vals ) { - // This seems ugly to wrap non-array's in an array just to unwrap again, // especially when most of the time it is not an array if ( !is_array( $tags[$tag] ) ) { @@ -165,7 +164,6 @@ class FormatMetadata extends ContextSource { } foreach ( $vals as &$val ) { - switch ( $tag ) { case 'Compression': switch ( $val ) { @@ -1683,7 +1681,6 @@ class FormatMetadata extends ContextSource { protected function getExtendedMetadataFromHook( File $file, array $extendedMetadata, &$maxCacheTime ) { - Hooks::run( 'GetExtendedMetadata', [ &$extendedMetadata, $file, @@ -1807,7 +1804,6 @@ class FormatMetadata extends ContextSource { $field['value'] = $this->resolveMultivalueValue( $field['value'] ); } } - } /** diff --git a/includes/page/ImagePage.php b/includes/page/ImagePage.php index af778682c7..db3ec1416e 100644 --- a/includes/page/ImagePage.php +++ b/includes/page/ImagePage.php @@ -215,7 +215,6 @@ class ImagePage extends Article { 'filepage', // always show the local local Filepage.css, bug 29277 'mediawiki.action.view.filepage', // Add MediaWiki styles for a file page ] ); - } /** diff --git a/includes/parser/LinkHolderArray.php b/includes/parser/LinkHolderArray.php index b32f43b893..e7712f2b74 100644 --- a/includes/parser/LinkHolderArray.php +++ b/includes/parser/LinkHolderArray.php @@ -267,10 +267,8 @@ class LinkHolderArray { * @param string $text */ public function replace( &$text ) { - $this->replaceInternal( $text ); $this->replaceInterwiki( $text ); - } /** @@ -414,7 +412,6 @@ class LinkHolderArray { $replacer->cb(), $text ); - } /** @@ -614,7 +611,6 @@ class LinkHolderArray { * @return string */ public function replaceText( $text ) { - $text = preg_replace_callback( '//', [ &$this, 'replaceTextCallback' ], diff --git a/includes/parser/ParserOptions.php b/includes/parser/ParserOptions.php index 9a1087886e..2900f41a97 100644 --- a/includes/parser/ParserOptions.php +++ b/includes/parser/ParserOptions.php @@ -733,7 +733,6 @@ class ParserOptions { $this->mThumbSize = $user->getOption( 'thumbsize' ); $this->mStubThreshold = $user->getStubThreshold(); $this->mUserLang = $lang; - } /** diff --git a/includes/resourceloader/ResourceLoader.php b/includes/resourceloader/ResourceLoader.php index 143f5cc678..b05b51b7fb 100644 --- a/includes/resourceloader/ResourceLoader.php +++ b/includes/resourceloader/ResourceLoader.php @@ -388,7 +388,6 @@ class ResourceLoader implements LoggerAwareInterface { } } } - } /** @@ -428,7 +427,6 @@ class ResourceLoader implements LoggerAwareInterface { // Keep track of their names so that they can be loaded together $this->testModuleNames[$id] = array_keys( $testModules[$id] ); } - } /** @@ -779,7 +777,6 @@ class ResourceLoader implements LoggerAwareInterface { $this->errors = []; echo $response; - } /** @@ -1142,7 +1139,6 @@ MESSAGE; protected static function makeLoaderImplementScript( $name, $scripts, $styles, $messages, $templates ) { - if ( $scripts instanceof XmlJsCode ) { $scripts = new XmlJsCode( "function ( $, jQuery, require, module ) {\n{$scripts->value}\n}" ); } elseif ( !is_string( $scripts ) && !is_array( $scripts ) ) { diff --git a/includes/search/SearchPostgres.php b/includes/search/SearchPostgres.php index 8ba49b60f9..5a50b176e9 100644 --- a/includes/search/SearchPostgres.php +++ b/includes/search/SearchPostgres.php @@ -62,7 +62,6 @@ class SearchPostgres extends SearchDatabase { * @return string */ function parseQuery( $term ) { - wfDebug( "parseQuery received: $term \n" ); # # No backslashes allowed @@ -115,7 +114,6 @@ class SearchPostgres extends SearchDatabase { wfDebug( "parseQuery returned: $searchstring \n" ); return $searchstring; - } /** diff --git a/includes/skins/BaseTemplate.php b/includes/skins/BaseTemplate.php index 6ea8b89bbc..65eb9b776e 100644 --- a/includes/skins/BaseTemplate.php +++ b/includes/skins/BaseTemplate.php @@ -289,7 +289,6 @@ abstract class BaseTemplate extends QuickTemplate { if ( $content !== '' ) { echo "
$content
"; } - } /** diff --git a/includes/skins/SkinTemplate.php b/includes/skins/SkinTemplate.php index 3efbd3bfaa..9c5600d0b6 100644 --- a/includes/skins/SkinTemplate.php +++ b/includes/skins/SkinTemplate.php @@ -196,7 +196,6 @@ class SkinTemplate extends Skin { } protected function setupTemplateForOutput() { - $request = $this->getRequest(); $user = $this->getUser(); $title = $this->getTitle(); @@ -257,7 +256,6 @@ class SkinTemplate extends Skin { if ( $oldContext ) { $this->setContext( $oldContext ); } - } /** @@ -1171,7 +1169,6 @@ class SkinTemplate extends Skin { * @return array */ private function buildContentActionUrls( $content_navigation ) { - // content_actions has been replaced with content_navigation for backwards // compatibility and also for skins that just want simple tabs content_actions // is now built by flattening the content_navigation arrays into one diff --git a/includes/specialpage/LoginSignupSpecialPage.php b/includes/specialpage/LoginSignupSpecialPage.php index 984e32bdb1..00c2416270 100644 --- a/includes/specialpage/LoginSignupSpecialPage.php +++ b/includes/specialpage/LoginSignupSpecialPage.php @@ -770,7 +770,6 @@ abstract class LoginSignupSpecialPage extends AuthManagerSpecialPage { } return $template; - } public function onAuthChangeFormFields( diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index 6daf19f5c3..252ac31e39 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -455,7 +455,6 @@ class SpecialSearch extends SpecialPage { $out->addHTML( "" ); Hooks::run( 'SpecialSearchResultsAppend', [ $this, $out, $term ] ); - } /** @@ -752,7 +751,6 @@ class SpecialSearch extends SpecialPage { * @return string */ protected function showHit( SearchResult $result, $terms, $position ) { - if ( $result->isBrokenTitle() ) { return ''; } @@ -972,7 +970,6 @@ class SpecialSearch extends SpecialPage { * @return string */ protected function showInterwikiHit( $result, $lastInterwiki, $query ) { - if ( $result->isBrokenTitle() ) { return ''; } @@ -1342,7 +1339,6 @@ class SpecialSearch extends SpecialPage { * @return bool */ protected function startsWithAll( $term ) { - $allkeyword = $this->msg( 'searchall' )->inContentLanguage()->text(); $parts = explode( ':', $term ); diff --git a/includes/user/User.php b/includes/user/User.php index 92a65f074c..2a59d5dacd 100644 --- a/includes/user/User.php +++ b/includes/user/User.php @@ -1658,7 +1658,6 @@ class User implements IDBAccessObject { // Extensions Hooks::run( 'GetBlockedStatus', [ &$this ] ); - } /** @@ -1690,7 +1689,6 @@ class User implements IDBAccessObject { * @return bool True if blacklisted. */ public function inDnsBlacklist( $ip, $bases ) { - $found = false; // @todo FIXME: IPv6 ??? (http://bugs.php.net/bug.php?id=33170) if ( IP::isIPv4( $ip ) ) { diff --git a/languages/classes/LanguageSr.php b/languages/classes/LanguageSr.php index fc91443dbb..886ee94a35 100644 --- a/languages/classes/LanguageSr.php +++ b/languages/classes/LanguageSr.php @@ -186,7 +186,6 @@ class SrConverter extends LanguageConverter { } else { return false; } - } } diff --git a/languages/classes/LanguageZh.php b/languages/classes/LanguageZh.php index d9111a65c5..e1099f8867 100644 --- a/languages/classes/LanguageZh.php +++ b/languages/classes/LanguageZh.php @@ -174,7 +174,6 @@ class LanguageZh extends LanguageZh_hans { * @return string */ function normalizeForSearch( $string, $autoVariant = 'zh-hans' ) { - // always convert to zh-hans before indexing. it should be // better to use zh-hans for search, since conversion from // Traditional to Simplified is less ambiguous than the @@ -183,7 +182,6 @@ class LanguageZh extends LanguageZh_hans { // LanguageZh_hans::normalizeForSearch $s = parent::normalizeForSearch( $s ); return $s; - } /** diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index c74cae2ada..552bec0463 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -459,7 +459,6 @@ abstract class Maintenance { * Add the default parameters to the scripts */ protected function addDefaultParams() { - # Generic (non script dependant) options: $this->addOption( 'help', 'Display this help message', false, false, 'h' ); @@ -546,7 +545,6 @@ abstract class Maintenance { . "for this script to run: $joined. Please enable them and then try again."; $this->error( $msg, 1 ); } - } /** diff --git a/maintenance/checkComposerLockUpToDate.php b/maintenance/checkComposerLockUpToDate.php index 3f0a83ddf2..b504bded77 100644 --- a/maintenance/checkComposerLockUpToDate.php +++ b/maintenance/checkComposerLockUpToDate.php @@ -60,7 +60,6 @@ class CheckComposerLockUpToDate extends Maintenance { // We couldn't find any out-of-date dependencies, so assume everything is ok! $this->output( "Your composer.lock file is up to date with current dependencies!\n" ); } - } } diff --git a/maintenance/createCommonPasswordCdb.php b/maintenance/createCommonPasswordCdb.php index f13dd930ce..388ad8a711 100644 --- a/maintenance/createCommonPasswordCdb.php +++ b/maintenance/createCommonPasswordCdb.php @@ -109,7 +109,6 @@ class GenerateCommonPassword extends Maintenance { } catch ( \Cdb\Exception $e ) { $this->error( "Error writing cdb file: " . $e->getMessage(), 2 ); } - } } diff --git a/tests/parser/TestFileReader.php b/tests/parser/TestFileReader.php index 59f88c9325..b6e811b1b8 100644 --- a/tests/parser/TestFileReader.php +++ b/tests/parser/TestFileReader.php @@ -264,7 +264,6 @@ class TestFileReader { $this->sectionLineNum = []; $this->sectionData = []; $this->section = null; - } /** diff --git a/tests/phpunit/includes/GitInfoTest.php b/tests/phpunit/includes/GitInfoTest.php index 9f4a01c9d8..89416f2ff2 100644 --- a/tests/phpunit/includes/GitInfoTest.php +++ b/tests/phpunit/includes/GitInfoTest.php @@ -18,7 +18,6 @@ class GitInfoTest extends MediaWikiTestCase { $this->assertEquals( 'master', $gitInfo->getCurrentBranch() ); $this->assertContains( '0123456789abcdef0123456789abcdef01234567', $gitInfo->getHeadViewUrl() ); - } public function testValidJsonData() { diff --git a/tests/phpunit/includes/HtmlTest.php b/tests/phpunit/includes/HtmlTest.php index bc5096639b..95c7a610b1 100644 --- a/tests/phpunit/includes/HtmlTest.php +++ b/tests/phpunit/includes/HtmlTest.php @@ -92,7 +92,6 @@ class HtmlTest extends MediaWikiTestCase { * @covers Html::expandAttributes */ public function testExpandAttributesSkipsNullAndFalse() { - # ## EMPTY ######## $this->assertEmpty( Html::expandAttributes( [ 'foo' => null ] ), @@ -190,7 +189,6 @@ class HtmlTest extends MediaWikiTestCase { Html::expandAttributes( [ 'zero' => 0 ] ), 'Number 0 value needs no quotes' ); - } /** diff --git a/tests/phpunit/includes/LinkFilterTest.php b/tests/phpunit/includes/LinkFilterTest.php index 61b165a4dc..428b0129a0 100644 --- a/tests/phpunit/includes/LinkFilterTest.php +++ b/tests/phpunit/includes/LinkFilterTest.php @@ -6,7 +6,6 @@ class LinkFilterTest extends MediaWikiLangTestCase { protected function setUp() { - parent::setUp(); $this->setMwGlobals( 'wgUrlProtocols', [ @@ -26,7 +25,6 @@ class LinkFilterTest extends MediaWikiLangTestCase { 'mms://', '//', ] ); - } /** @@ -38,11 +36,9 @@ class LinkFilterTest extends MediaWikiLangTestCase { * @return string Regex */ function createRegexFromLIKE( $like ) { - $regex = '!^'; foreach ( $like as $item ) { - if ( $item instanceof LikeMatch ) { if ( $item->toString() == '%' ) { $regex .= '.*'; @@ -58,7 +54,6 @@ class LinkFilterTest extends MediaWikiLangTestCase { $regex .= '$!'; return $regex; - } /** @@ -67,7 +62,6 @@ class LinkFilterTest extends MediaWikiLangTestCase { * @return array */ public static function provideValidPatterns() { - return [ // Protocol, Search pattern, URL which matches the pattern [ 'http://', '*.test.com', 'http://www.test.com' ], @@ -164,7 +158,6 @@ class LinkFilterTest extends MediaWikiLangTestCase { // [ '', 'https://*.wikimedia.org/r/#/q/status:open,n,z', // 'https://gerrit.wikimedia.org/XXX/r/#/q/status:open,n,z', false ], ]; - } /** @@ -181,7 +174,6 @@ class LinkFilterTest extends MediaWikiLangTestCase { * @param bool $shouldBeFound Should the URL be found? (defaults true) */ function testMakeLikeArrayWithValidPatterns( $protocol, $pattern, $url, $shouldBeFound = true ) { - $indexes = wfMakeUrlIndexes( $url ); $likeArray = LinkFilter::makeLikeArray( $pattern, $protocol ); @@ -211,7 +203,6 @@ class LinkFilterTest extends MediaWikiLangTestCase { "Search pattern '$protocol$pattern' should not find url '$url' \n$debugmsg" ); } - } /** @@ -220,7 +211,6 @@ class LinkFilterTest extends MediaWikiLangTestCase { * @return array */ public static function provideInvalidPatterns() { - return [ [ '' ], [ '*' ], @@ -240,7 +230,6 @@ class LinkFilterTest extends MediaWikiLangTestCase { [ 'test.com/*/index' ], [ 'test.com/dir/index?arg=*' ], ]; - } /** @@ -253,12 +242,10 @@ class LinkFilterTest extends MediaWikiLangTestCase { * @param string $pattern Invalid search pattern */ function testMakeLikeArrayWithInvalidPatterns( $pattern ) { - $this->assertFalse( LinkFilter::makeLikeArray( $pattern ), "'$pattern' is not a valid pattern and should be rejected" ); - } } diff --git a/tests/phpunit/includes/PagePropsTest.php b/tests/phpunit/includes/PagePropsTest.php index cc1708a2b4..29c9e228f2 100644 --- a/tests/phpunit/includes/PagePropsTest.php +++ b/tests/phpunit/includes/PagePropsTest.php @@ -266,11 +266,9 @@ class TestPageProps extends MediaWikiLangTestCase { } protected function setProperties( $pageID, $properties ) { - $rows = []; foreach ( $properties as $propertyName => $propertyValue ) { - $row = [ 'pp_page' => $pageID, 'pp_propname' => $propertyName, @@ -295,11 +293,9 @@ class TestPageProps extends MediaWikiLangTestCase { } protected function setProperty( $pageID, $propertyName, $propertyValue ) { - $properties = []; $properties[$propertyName] = $propertyValue; $this->setProperties( $pageID, $properties ); - } } diff --git a/tests/phpunit/includes/TemplateCategoriesTest.php b/tests/phpunit/includes/TemplateCategoriesTest.php index 9359568375..152602ac5e 100644 --- a/tests/phpunit/includes/TemplateCategoriesTest.php +++ b/tests/phpunit/includes/TemplateCategoriesTest.php @@ -91,6 +91,5 @@ class TemplateCategoriesTest extends MediaWikiLangTestCase { $title->getParentCategories(), 'Verify that the page is no longer in the category after template deletion' ); - } } diff --git a/tests/phpunit/includes/api/ApiContinuationManagerTest.php b/tests/phpunit/includes/api/ApiContinuationManagerTest.php index 6da16a0931..3ad16d1322 100644 --- a/tests/phpunit/includes/api/ApiContinuationManagerTest.php +++ b/tests/phpunit/includes/api/ApiContinuationManagerTest.php @@ -195,7 +195,6 @@ class ApiContinuationManagerTest extends MediaWikiTestCase { 'Expected exception' ); } - } } diff --git a/tests/phpunit/includes/api/ApiResultTest.php b/tests/phpunit/includes/api/ApiResultTest.php index 48472cff91..98e24fb666 100644 --- a/tests/phpunit/includes/api/ApiResultTest.php +++ b/tests/phpunit/includes/api/ApiResultTest.php @@ -1230,7 +1230,6 @@ class ApiResultTest extends MediaWikiTestCase { ], ], ]; - } /** @@ -1380,7 +1379,6 @@ class ApiResultTest extends MediaWikiTestCase { 'two' => 2, ], $arr['foo'] ); } - } class ApiResultTestStringifiableObject { diff --git a/tests/phpunit/includes/api/ApiRevisionDeleteTest.php b/tests/phpunit/includes/api/ApiRevisionDeleteTest.php index 6359983d6e..d8282be159 100644 --- a/tests/phpunit/includes/api/ApiRevisionDeleteTest.php +++ b/tests/phpunit/includes/api/ApiRevisionDeleteTest.php @@ -25,7 +25,6 @@ class ApiRevisionDeleteTest extends ApiTestCase { $this->revs[] = Title::newFromText( self::$page ) ->getLatestRevID( Title::GAID_FOR_UPDATE ); } - } public function testHidingRevisions() { diff --git a/tests/phpunit/includes/auth/AuthManagerTest.php b/tests/phpunit/includes/auth/AuthManagerTest.php index 13486e2c43..f57db11b23 100644 --- a/tests/phpunit/includes/auth/AuthManagerTest.php +++ b/tests/phpunit/includes/auth/AuthManagerTest.php @@ -695,7 +695,6 @@ class AuthManagerTest extends \MediaWikiTestCase { $ex->getMessage() ); } - } public function testBeginAuthentication() { @@ -3265,7 +3264,6 @@ class AuthManagerTest extends \MediaWikiTestCase { $this->manager->removeAuthenticationSessionData( null ); $this->assertNull( $this->manager->getAuthenticationSessionData( 'foo' ) ); $this->assertNull( $this->manager->getAuthenticationSessionData( 'bar' ) ); - } public function testCanLinkAccounts() { diff --git a/tests/phpunit/includes/auth/EmailNotificationSecondaryAuthenticationProviderTest.php b/tests/phpunit/includes/auth/EmailNotificationSecondaryAuthenticationProviderTest.php index c52c3e9f54..ec4bea11a1 100644 --- a/tests/phpunit/includes/auth/EmailNotificationSecondaryAuthenticationProviderTest.php +++ b/tests/phpunit/includes/auth/EmailNotificationSecondaryAuthenticationProviderTest.php @@ -104,6 +104,5 @@ class EmailNotificationSecondaryAuthenticationProviderTest extends \PHPUnit_Fram $authManager->setAuthenticationSessionData( 'no-email', true ); $provider->setManager( $authManager ); $provider->beginSecondaryAccountCreation( $userNotExpectsConfirmation, $creator, [] ); - } } diff --git a/tests/phpunit/includes/auth/LocalPasswordPrimaryAuthenticationProviderTest.php b/tests/phpunit/includes/auth/LocalPasswordPrimaryAuthenticationProviderTest.php index 088dd00fe8..caf1680e3e 100644 --- a/tests/phpunit/includes/auth/LocalPasswordPrimaryAuthenticationProviderTest.php +++ b/tests/phpunit/includes/auth/LocalPasswordPrimaryAuthenticationProviderTest.php @@ -328,7 +328,6 @@ class LocalPasswordPrimaryAuthenticationProviderTest extends \MediaWikiTestCase AuthenticationResponse::newPass( $userName ), $provider->beginPrimaryAuthentication( $reqs ) ); - } /** @@ -645,7 +644,6 @@ class LocalPasswordPrimaryAuthenticationProviderTest extends \MediaWikiTestCase $this->assertNull( $provider->finishAccountCreation( $user, $user, $res2 ) ); $ret = $provider->beginPrimaryAuthentication( $reqs ); $this->assertEquals( AuthenticationResponse::PASS, $ret->status, 'new password is set' ); - } } diff --git a/tests/phpunit/includes/auth/TemporaryPasswordPrimaryAuthenticationProviderTest.php b/tests/phpunit/includes/auth/TemporaryPasswordPrimaryAuthenticationProviderTest.php index bc78c08f2c..d4ebe34a98 100644 --- a/tests/phpunit/includes/auth/TemporaryPasswordPrimaryAuthenticationProviderTest.php +++ b/tests/phpunit/includes/auth/TemporaryPasswordPrimaryAuthenticationProviderTest.php @@ -347,7 +347,6 @@ class TemporaryPasswordPrimaryAuthenticationProviderTest extends \MediaWikiTestC 'wrongpassword', $ret->message->getKey() ); - } /** diff --git a/tests/phpunit/includes/auth/UserDataAuthenticationRequestTest.php b/tests/phpunit/includes/auth/UserDataAuthenticationRequestTest.php index 7fe335117c..7dea123c12 100644 --- a/tests/phpunit/includes/auth/UserDataAuthenticationRequestTest.php +++ b/tests/phpunit/includes/auth/UserDataAuthenticationRequestTest.php @@ -36,7 +36,6 @@ class UserDataAuthenticationRequestTest extends AuthenticationRequestTestCase { $this->assertSame( $email ?: 'default@example.com', $user->getEmail() ); $this->assertSame( $realname ?: 'Fake Name', $user->getRealName() ); } - } public static function providePopulateUser() { diff --git a/tests/phpunit/includes/exception/MWExceptionTest.php b/tests/phpunit/includes/exception/MWExceptionTest.php index 0e87ffa42f..7c36f7d13d 100644 --- a/tests/phpunit/includes/exception/MWExceptionTest.php +++ b/tests/phpunit/includes/exception/MWExceptionTest.php @@ -173,7 +173,6 @@ class MWExceptionTest extends MediaWikiTestCase { * @dataProvider provideJsonSerializedKeys */ public function testJsonserializeexceptionKeys( $expectedKeyType, $exClass, $key ) { - # Make sure we log a backtrace: $this->setMwGlobals( [ 'wgLogExceptionBacktrace' => true ] ); @@ -235,7 +234,6 @@ class MWExceptionTest extends MediaWikiTestCase { MWExceptionHandler::jsonSerializeException( new Exception() ) ); $this->assertObjectNotHasAttribute( 'backtrace', $json ); - } } diff --git a/tests/phpunit/includes/linker/LinkRendererTest.php b/tests/phpunit/includes/linker/LinkRendererTest.php index 70c0ece215..6d096c208b 100644 --- a/tests/phpunit/includes/linker/LinkRendererTest.php +++ b/tests/phpunit/includes/linker/LinkRendererTest.php @@ -24,7 +24,6 @@ class LinkRendererTest extends MediaWikiLangTestCase { 'wgScript' => '/w/index.php', ] ); $this->factory = MediaWikiServices::getInstance()->getLinkRendererFactory(); - } public function testMergeAttribs() { diff --git a/tests/phpunit/includes/media/ExifBitmapTest.php b/tests/phpunit/includes/media/ExifBitmapTest.php index f70b42de42..47ed67bdb1 100644 --- a/tests/phpunit/includes/media/ExifBitmapTest.php +++ b/tests/phpunit/includes/media/ExifBitmapTest.php @@ -17,7 +17,6 @@ class ExifBitmapTest extends MediaWikiMediaTestCase { $this->setMwGlobals( 'wgShowEXIF', true ); $this->handler = new ExifBitmapHandler; - } /** diff --git a/tests/phpunit/includes/session/SessionProviderTest.php b/tests/phpunit/includes/session/SessionProviderTest.php index 4cbeeb954c..8284d05e97 100644 --- a/tests/phpunit/includes/session/SessionProviderTest.php +++ b/tests/phpunit/includes/session/SessionProviderTest.php @@ -138,7 +138,6 @@ class SessionProviderTest extends MediaWikiTestCase { $ex->getMessage() ); } - } public function testHashToSessionId() { diff --git a/tests/phpunit/includes/session/SessionTest.php b/tests/phpunit/includes/session/SessionTest.php index 3815416c31..e6a6ad351f 100644 --- a/tests/phpunit/includes/session/SessionTest.php +++ b/tests/phpunit/includes/session/SessionTest.php @@ -299,7 +299,6 @@ class SessionTest extends MediaWikiTestCase { $session->resetAllTokens(); $this->assertArrayNotHasKey( 'wsTokenSecrets', $backend->data ); - } /** diff --git a/tests/phpunit/includes/user/UserTest.php b/tests/phpunit/includes/user/UserTest.php index 34548c0481..199fc8f1bc 100644 --- a/tests/phpunit/includes/user/UserTest.php +++ b/tests/phpunit/includes/user/UserTest.php @@ -269,7 +269,6 @@ class UserTest extends MediaWikiTestCase { // let the user have a few (3) edits $page = WikiPage::factory( Title::newFromText( 'Help:UserTest_EditCount' ) ); for ( $i = 0; $i < 3; $i++ ) { - $page->doEditContent( ContentHandler::makeContent( (string)$i, $page->getTitle() ), 'test', @@ -505,7 +504,6 @@ class UserTest extends MediaWikiTestCase { public function testGetId() { $user = static::getTestUser()->getUser(); $this->assertTrue( $user->getId() > 0 ); - } /** -- 2.20.1