Remove unneeded empty lines at begin of if/else/foreach body
authorumherirrender <umherirrender_de.wp@web.de>
Fri, 19 Jun 2015 18:05:45 +0000 (20:05 +0200)
committerumherirrender <umherirrender_de.wp@web.de>
Fri, 19 Jun 2015 18:05:45 +0000 (20:05 +0200)
An if body must not begin with an empty line

Change-Id: I62b058be337fcc85a120fcd3dadce564db59a271

30 files changed:
includes/EditPage.php
includes/OutputPage.php
includes/Revision.php
includes/Sanitizer.php
includes/actions/UnprotectAction.php
includes/api/ApiBase.php
includes/cache/LinkCache.php
includes/cache/LocalisationCache.php
includes/changes/EnhancedChangesList.php
includes/content/WikitextContent.php
includes/context/RequestContext.php
includes/db/LoadBalancer.php
includes/diff/DifferenceEngine.php
includes/filebackend/FSFile.php
includes/filebackend/TempFSFile.php
includes/htmlform/HTMLSelectAndOtherField.php
includes/jobqueue/JobQueue.php
includes/media/FormatMetadata.php
includes/media/SVGMetadataExtractor.php
includes/media/XMP.php
includes/parser/LinkHolderArray.php
includes/parser/Parser.php
includes/parser/Preprocessor_DOM.php
includes/parser/Preprocessor_Hash.php
includes/resourceloader/ResourceLoaderWikiModule.php
includes/specialpage/SpecialPageFactory.php
includes/specials/SpecialExport.php
includes/specials/SpecialMIMEsearch.php
includes/specials/SpecialProtectedtitles.php
includes/upload/UploadBase.php

index ee67d01..b439459 100644 (file)
@@ -1037,7 +1037,6 @@ class EditPage {
                                $undo = $wgRequest->getInt( 'undo' );
 
                                if ( $undo > 0 && $undoafter > 0 ) {
-
                                        $undorev = Revision::newFromId( $undo );
                                        $oldrev = Revision::newFromId( $undoafter );
 
@@ -1046,8 +1045,8 @@ class EditPage {
                                        # Otherwise, $content will be left as-is.
                                        if ( !is_null( $undorev ) && !is_null( $oldrev ) &&
                                                !$undorev->isDeleted( Revision::DELETED_TEXT ) &&
-                                               !$oldrev->isDeleted( Revision::DELETED_TEXT ) ) {
-
+                                               !$oldrev->isDeleted( Revision::DELETED_TEXT )
+                                       ) {
                                                $content = $this->mArticle->getUndoContent( $undorev, $oldrev );
 
                                                if ( $content === false ) {
index 7322404..f02f752 100644 (file)
@@ -2282,7 +2282,6 @@ class OutputPage extends ContextSource {
                if ( $this->mArticleBodyOnly ) {
                        echo $this->mBodytext;
                } else {
-
                        $sk = $this->getSkin();
                        // add skin specific modules
                        $modules = $sk->getDefaultModules();
index 9bb4d16..5939715 100644 (file)
@@ -194,8 +194,8 @@ class Revision implements IDBAccessObject {
 
                if ( !isset( $attribs['title'] )
                        && isset( $row->ar_namespace )
-                       && isset( $row->ar_title ) ) {
-
+                       && isset( $row->ar_title )
+               ) {
                        $attribs['title'] = Title::makeTitle( $row->ar_namespace, $row->ar_title );
                }
 
index 677d5a4..2340cd9 100644 (file)
@@ -374,7 +374,6 @@ class Sanitizer {
                // are changed (like in the screwed up test system) we will re-initialise the settings.
                $globalContext = implode( '-', compact( 'wgAllowMicrodataAttributes', 'wgAllowImageTag' ) );
                if ( !$staticInitialised || $staticInitialised != $globalContext ) {
-
                        $htmlpairsStatic = array( # Tags that must be closed
                                'b', 'bdi', 'del', 'i', 'ins', 'u', 'font', 'big', 'small', 'sub', 'sup', 'h1',
                                'h2', 'h3', 'h4', 'h5', 'h6', 'cite', 'code', 'em', 's',
index bc28c8e..559cfaf 100644 (file)
@@ -37,7 +37,6 @@ class UnprotectAction extends ProtectAction {
        }
 
        public function show() {
-
                $this->page->unprotect();
        }
 }
index 55f9677..4b76e65 100644 (file)
@@ -1056,7 +1056,6 @@ abstract class ApiBase extends ContextSource {
         */
        protected function validateLimit( $paramName, &$value, $min, $max, $botMax = null, $enforceLimits = false ) {
                if ( !is_null( $min ) && $value < $min ) {
-
                        $msg = $this->encodeParamName( $paramName ) . " may not be less than $min (set to $value)";
                        $this->warnOrDie( $msg, $enforceLimits );
                        $value = $min;
@@ -2646,7 +2645,6 @@ abstract class ApiBase extends ContextSource {
                wfDeprecated( __METHOD__, '1.25' );
                $params = $this->getFinalParams( ApiBase::GET_VALUES_FOR_HELP );
                if ( $params ) {
-
                        $paramsDescription = $this->getFinalParamDescription();
                        $msg = '';
                        $paramPrefix = "\n" . str_repeat( ' ', 24 );
index eace1ee..e8cc5e5 100644 (file)
@@ -220,17 +220,14 @@ class LinkCache {
 
                $key = $nt->getPrefixedDBkey();
                if ( $this->isBadLink( $key ) || $nt->isExternal() ) {
-
                        return 0;
                }
                $id = $this->getGoodLinkID( $key );
                if ( $id != 0 ) {
-
                        return $id;
                }
 
                if ( $key === '' ) {
-
                        return 0;
                }
 
index 5b802aa..276e84a 100644 (file)
@@ -539,13 +539,11 @@ class LocalisationCache {
        public function readJSONFile( $fileName ) {
 
                if ( !is_readable( $fileName ) ) {
-
                        return array();
                }
 
                $json = file_get_contents( $fileName );
                if ( $json === false ) {
-
                        return array();
                }
 
index 19277f1..54cde0d 100644 (file)
@@ -330,7 +330,6 @@ class EnhancedChangesList extends ChangesList {
                        } elseif ( !ChangesList::userCan( $rcObj, Revision::DELETED_TEXT, $this->getUser() ) ) {
                                $link = '<span class="history-deleted">' . $rcObj->timestamp . '</span> ';
                        } else {
-
                                $link = Linker::linkKnown(
                                        $rcObj->getTitle(),
                                        $rcObj->timestamp,
index 3b449b6..8beae39 100644 (file)
@@ -82,7 +82,6 @@ class WikitextContent extends TextContent {
                $text = $with->getNativeData();
 
                if ( strval( $sectionId ) === '' ) {
-
                        return $with; # XXX: copy first?
                }
 
index 4e790c0..d1bc597 100644 (file)
@@ -380,7 +380,6 @@ class RequestContext implements IContextSource {
         */
        public function getSkin() {
                if ( $this->skin === null ) {
-
                        $skin = null;
                        Hooks::run( 'RequestContextCreateSkin', array( $this, &$skin ) );
                        $factory = SkinFactory::getDefaultInstance();
index 99c9a14..069185b 100644 (file)
@@ -538,7 +538,6 @@ class LoadBalancer {
                # Now we have an explicit index into the servers array
                $conn = $this->openConnection( $i, $wiki );
                if ( !$conn ) {
-
                        return $this->reportConnectionError();
                }
 
index ac29ae0..c138eec 100644 (file)
@@ -685,24 +685,20 @@ class DifferenceEngine extends ContextSource {
                $this->mCacheHit = true;
                // Check if the diff should be hidden from this user
                if ( !$this->loadRevisionData() ) {
-
                        return false;
                } elseif ( $this->mOldRev &&
                        !$this->mOldRev->userCan( Revision::DELETED_TEXT, $this->getUser() )
                ) {
-
                        return false;
                } elseif ( $this->mNewRev &&
                        !$this->mNewRev->userCan( Revision::DELETED_TEXT, $this->getUser() )
                ) {
-
                        return false;
                }
                // Short-circuit
                if ( $this->mOldRev === false || ( $this->mOldRev && $this->mNewRev
                        && $this->mOldRev->getID() == $this->mNewRev->getID() )
                ) {
-
                        return '';
                }
                // Cacheable?
@@ -726,7 +722,6 @@ class DifferenceEngine extends ContextSource {
 
                // Loadtext is permission safe, this just clears out the diff
                if ( !$this->loadText() ) {
-
                        return false;
                }
 
@@ -859,12 +854,10 @@ class DifferenceEngine extends ContextSource {
 
                        $tempFile1 = fopen( $tempName1, "w" );
                        if ( !$tempFile1 ) {
-
                                return false;
                        }
                        $tempFile2 = fopen( $tempName2, "w" );
                        if ( !$tempFile2 ) {
-
                                return false;
                        }
                        fwrite( $tempFile1, $otext );
index a75f328..213bb87 100644 (file)
@@ -200,7 +200,6 @@ class FSFile {
        public function getSha1Base36( $recache = false ) {
 
                if ( $this->sha1Base36 !== null && !$recache ) {
-
                        return $this->sha1Base36;
                }
 
index 312b65c..46b5360 100644 (file)
@@ -67,7 +67,6 @@ class TempFSFile extends FSFile {
                                break; // got it
                        }
                        if ( $attempt >= 5 ) {
-
                                return null; // give up
                        }
                }
index a1c0c95..23ca3bf 100644 (file)
@@ -71,7 +71,6 @@ class HTMLSelectAndOtherField extends HTMLSelectField {
         */
        function loadDataFromRequest( $request ) {
                if ( $request->getCheck( $this->mName ) ) {
-
                        $list = $request->getText( $this->mName );
                        $text = $request->getText( $this->mName . '-other' );
 
index b4a2184..913aea0 100644 (file)
@@ -637,7 +637,6 @@ abstract class JobQueue {
         * @since 1.22
         */
        final public function getSiblingQueuesWithJobs( array $types ) {
-
                return $this->doGetSiblingQueuesWithJobs( $types );
        }
 
@@ -661,7 +660,6 @@ abstract class JobQueue {
         * @since 1.22
         */
        final public function getSiblingQueueSizes( array $types ) {
-
                return $this->doGetSiblingQueueSizes( $types );
        }
 
index 8127837..17e3dda 100644 (file)
@@ -1575,7 +1575,6 @@ class FormatMetadata extends ContextSource {
 
                // If revision deleted, exit immediately
                if ( $file->isDeleted( File::DELETED_FILE ) ) {
-
                        return array();
                }
 
index 6c53bc5..8afa31b 100644 (file)
@@ -262,7 +262,6 @@ class SVGReader {
                        } elseif ( $this->reader->namespaceURI == self::NS_SVG
                                && $this->reader->nodeType == XMLReader::ELEMENT
                        ) {
-
                                $sysLang = $this->reader->getAttribute( 'systemLanguage' );
                                if ( !is_null( $sysLang ) && $sysLang !== '' ) {
                                        // See http://www.w3.org/TR/SVG/struct.html#SystemLanguageAttribute
index b9d0ae5..a838355 100644 (file)
@@ -638,7 +638,6 @@ class XMPReader implements LoggerAwareInterface {
                // Validate structures.
                list( $ns, $tag ) = explode( ' ', $elm, 2 );
                if ( isset( $this->items[$ns][$tag]['validate'] ) ) {
-
                        $info =& $this->items[$ns][$tag];
                        $finalName = isset( $info['map_name'] )
                                ? $info['map_name'] : $tag;
index 7026c5c..b4ca7c8 100644 (file)
@@ -560,7 +560,6 @@ class LinkHolderArray {
 
                        // for each found variants, figure out link holders and replace
                        foreach ( $varRes as $s ) {
-
                                $variantTitle = Title::makeTitle( $s->page_namespace, $s->page_title );
                                $varPdbk = $variantTitle->getPrefixedDBkey();
                                $vardbk = $variantTitle->getDBkey();
index 432e12a..3183689 100644 (file)
@@ -3438,7 +3438,6 @@ class Parser {
 
                # SUBST
                if ( !$found ) {
-
                        $substMatch = $this->mSubstWords->matchStartAndRemove( $part1 );
 
                        # Possibilities for substMatch: "subst", "safesubst" or FALSE
@@ -3496,7 +3495,6 @@ class Parser {
 
                # Parser functions
                if ( !$found ) {
-
                        $colonPos = strpos( $part1, ':' );
                        if ( $colonPos !== false ) {
                                $func = substr( $part1, 0, $colonPos );
index 56cddce..718ca35 100644 (file)
@@ -154,7 +154,6 @@ class Preprocessor_DOM implements Preprocessor {
                $cacheable = ( $wgPreprocessorCacheThreshold !== false
                        && strlen( $text ) > $wgPreprocessorCacheThreshold );
                if ( $cacheable ) {
-
                        $cacheKey = wfMemcKey( 'preprocess-xml', md5( $text ), $flags );
                        $cacheValue = $wgMemc->get( $cacheKey );
                        if ( $cacheValue ) {
index 308ef44..d1ad39c 100644 (file)
@@ -119,7 +119,6 @@ class Preprocessor_Hash implements Preprocessor {
                        && strlen( $text ) > $wgPreprocessorCacheThreshold;
 
                if ( $cacheable ) {
-
                        $cacheKey = wfMemcKey( 'preprocess-hash', md5( $text ), $flags );
                        $cacheValue = $wgMemc->get( $cacheKey );
                        if ( $cacheValue ) {
index 1561dae..a4d94f8 100644 (file)
@@ -291,7 +291,6 @@ class ResourceLoaderWikiModule extends ResourceLoaderModule {
                $pages = $this->getPages( $context );
                $key = implode( '|', array_keys( $pages ) );
                if ( !isset( $this->titleInfo[$key] ) ) {
-
                        $this->titleInfo[$key] = array();
                        $batch = new LinkBatch;
                        foreach ( $pages as $titleText => $options ) {
index dedfcb6..3786b36 100644 (file)
@@ -572,7 +572,6 @@ class SpecialPageFactory {
                                $context->setTitle( $page->getPageTitle( $par ) );
                        }
                } elseif ( !$page->isIncludable() ) {
-
                        return false;
                }
 
index 920d34b..69b795d 100644 (file)
@@ -335,7 +335,6 @@ class SpecialExport extends SpecialPage {
                if ( $exportall ) {
                        $history = WikiExporter::FULL;
                } else {
-
                        $pageSet = array(); // Inverted index of all pages to look up
 
                        // Split up and normalize input
index 60225ea..6c7133f 100644 (file)
@@ -109,7 +109,6 @@ class MIMEsearchPage extends QueryPage {
         * Return HTML to put just before the results.
         */
        function getPageHeader() {
-
                return Xml::openElement(
                                'form',
                                array( 'id' => 'specialmimesearch', 'method' => 'get', 'action' => wfScript() )
index 0e1ce53..85ce78f 100644 (file)
@@ -67,10 +67,8 @@ class SpecialProtectedtitles extends SpecialPage {
         * @return string
         */
        function formatRow( $row ) {
-
                $title = Title::makeTitleSafe( $row->pt_namespace, $row->pt_title );
                if ( !$title ) {
-
                        return Html::rawElement(
                                'li',
                                array(),
index f17681c..426c752 100644 (file)
@@ -288,7 +288,6 @@ abstract class UploadBase {
                 * If there was no filename or a zero size given, give up quick.
                 */
                if ( $this->isEmptyFile() ) {
-
                        return array( 'status' => self::EMPTY_FILE );
                }
 
@@ -297,7 +296,6 @@ abstract class UploadBase {
                 */
                $maxSize = self::getMaxUploadSize( $this->getSourceType() );
                if ( $this->mFileSize > $maxSize ) {
-
                        return array(
                                'status' => self::FILE_TOO_LARGE,
                                'max' => $maxSize,
@@ -311,7 +309,6 @@ abstract class UploadBase {
                 */
                $verification = $this->verifyFile();
                if ( $verification !== true ) {
-
                        return array(
                                'status' => self::VERIFICATION_ERROR,
                                'details' => $verification
@@ -323,7 +320,6 @@ abstract class UploadBase {
                 */
                $result = $this->validateName();
                if ( $result !== true ) {
-
                        return $result;
                }
 
@@ -331,7 +327,6 @@ abstract class UploadBase {
                if ( !Hooks::run( 'UploadVerification',
                        array( $this->mDestName, $this->mTempPath, &$error ) )
                ) {
-
                        return array( 'status' => self::HOOK_ABORTED, 'error' => $error );
                }
 
@@ -380,7 +375,6 @@ abstract class UploadBase {
                        wfDebug( "mime: <$mime> extension: <{$this->mFinalExtension}>\n" );
                        global $wgMimeTypeBlacklist;
                        if ( $this->checkFileExtension( $mime, $wgMimeTypeBlacklist ) ) {
-
                                return array( 'filetype-badmime', $mime );
                        }
 
@@ -394,7 +388,6 @@ abstract class UploadBase {
                        $ieTypes = $magic->getIEMimeTypes( $this->mTempPath, $chunk, $extMime );
                        foreach ( $ieTypes as $ieType ) {
                                if ( $this->checkFileExtension( $ieType, $wgMimeTypeBlacklist ) ) {
-
                                        return array( 'filetype-bad-ie-mime', $ieType );
                                }
                        }
@@ -413,7 +406,6 @@ abstract class UploadBase {
 
                $status = $this->verifyPartialFile();
                if ( $status !== true ) {
-
                        return $status;
                }
 
@@ -423,7 +415,6 @@ abstract class UploadBase {
                if ( $wgVerifyMimeType ) {
                        # XXX: Missing extension will be caught by validateName() via getTitle()
                        if ( $this->mFinalExtension != '' && !$this->verifyExtension( $mime, $this->mFinalExtension ) ) {
-
                                return array( 'filetype-mime-mismatch', $this->mFinalExtension, $mime );
                        }
                }
@@ -433,7 +424,6 @@ abstract class UploadBase {
                        if ( $this->mFinalExtension == 'svg' || $mime == 'image/svg+xml' ) {
                                $svgStatus = $this->detectScriptInSvg( $this->mTempPath, false );
                                if ( $svgStatus !== false ) {
-
                                        return $svgStatus;
                                }
                        }
@@ -451,7 +441,6 @@ abstract class UploadBase {
 
                Hooks::run( 'UploadVerifyFile', array( $this, $mime, &$status ) );
                if ( $status !== true ) {
-
                        return $status;
                }
 
@@ -480,20 +469,17 @@ abstract class UploadBase {
                $mime = $this->mFileProps['file-mime'];
                $status = $this->verifyMimeType( $mime );
                if ( $status !== true ) {
-
                        return $status;
                }
 
                # check for htmlish code and javascript
                if ( !$wgDisableUploadScriptChecks ) {
                        if ( self::detectScript( $this->mTempPath, $mime, $this->mFinalExtension ) ) {
-
                                return array( 'uploadscripted' );
                        }
                        if ( $this->mFinalExtension == 'svg' || $mime == 'image/svg+xml' ) {
                                $svgStatus = $this->detectScriptInSvg( $this->mTempPath, true );
                                if ( $svgStatus !== false ) {
-
                                        return $svgStatus;
                                }
                        }
@@ -509,12 +495,10 @@ abstract class UploadBase {
                                $errors = $zipStatus->getErrorsArray();
                                $error = reset( $errors );
                                if ( $error[0] !== 'zip-wrong-format' ) {
-
                                        return $error;
                                }
                        }
                        if ( $this->mJavaDetected ) {
-
                                return array( 'uploadjava' );
                        }
                }
@@ -522,7 +506,6 @@ abstract class UploadBase {
                # Scan the uploaded file for viruses
                $virus = $this->detectVirus( $this->mTempPath );
                if ( $virus ) {
-
                        return array( 'uploadvirus', $virus );
                }
 
@@ -1076,7 +1059,6 @@ abstract class UploadBase {
                $chunk = strtolower( $chunk );
 
                if ( !$chunk ) {
-
                        return false;
                }
 
@@ -1100,7 +1082,6 @@ abstract class UploadBase {
 
                # check for HTML doctype
                if ( preg_match( "/<!DOCTYPE *X?HTML/i", $chunk ) ) {
-
                        return true;
                }
 
@@ -1108,7 +1089,6 @@ abstract class UploadBase {
                // PHP/expat will interpret the given encoding in the xml declaration (bug 47304)
                if ( $extension == 'svg' || strpos( $mime, 'image/svg' ) === 0 ) {
                        if ( self::checkXMLEncodingMissmatch( $file ) ) {
-
                                return true;
                        }
                }