Added space after switch/Removed spaces after unset
authorumherirrender <umherirrender_de.wp@web.de>
Fri, 26 Apr 2013 14:42:31 +0000 (16:42 +0200)
committerumherirrender <umherirrender_de.wp@web.de>
Fri, 26 Apr 2013 14:42:31 +0000 (16:42 +0200)
While at it, added/removed some other spaces in the same files

Change-Id: I84d8001aa123a008807ad5eb76f396aed7c899a4

46 files changed:
includes/AjaxDispatcher.php
includes/Article.php
includes/Autopromote.php
includes/Block.php
includes/FormOptions.php
includes/GlobalFunctions.php
includes/HttpFunctions.php
includes/Import.php
includes/MimeMagic.php
includes/SkinLegacy.php
includes/SkinTemplate.php
includes/Title.php
includes/api/ApiEditPage.php
includes/api/ApiFormatXml.php
includes/api/ApiPageSet.php
includes/api/ApiQueryRecentChanges.php
includes/api/ApiUpload.php
includes/db/DatabaseMssql.php
includes/db/DatabaseOracle.php
includes/db/DatabasePostgres.php
includes/diff/DairikiDiff.php
includes/installer/LocalSettingsGenerator.php
includes/logging/LogFormatter.php
includes/logging/LogPage.php
includes/media/BitmapMetadataHandler.php
includes/media/FormatMetadata.php
includes/media/IPTC.php
includes/media/SVGMetadataExtractor.php
includes/media/XMP.php
includes/parser/CoreParserFunctions.php
includes/parser/Parser.php
includes/search/SearchEngine.php
includes/search/SearchMySQL.php
includes/specials/SpecialUnblock.php
includes/specials/SpecialUpload.php
includes/specials/SpecialWatchlist.php
languages/Language.php
languages/classes/LanguageKk.php
maintenance/backup.inc
maintenance/backupPrefetch.inc
maintenance/backupTextPass.inc
maintenance/getConfiguration.php
maintenance/language/checkLanguage.inc
maintenance/mwdocgen.php
skins/Vector.php
tests/phpunit/includes/RequestContextTest.php

index b00cf30..e22fe20 100644 (file)
@@ -63,7 +63,7 @@ class AjaxDispatcher {
                        $this->mode = "post";
                }
 
-               switch( $this->mode ) {
+               switch ( $this->mode ) {
                        case 'get':
                                $this->func_name = isset( $_GET["rs"] ) ? $_GET["rs"] : '';
                                if ( ! empty( $_GET["rsargs"] ) ) {
index 1354a48..87b94ae 100644 (file)
@@ -160,7 +160,7 @@ class Article implements Page {
                $page = null;
                wfRunHooks( 'ArticleFromTitle', array( &$title, &$page ) );
                if ( !$page ) {
-                       switch( $title->getNamespace() ) {
+                       switch ( $title->getNamespace() ) {
                                case NS_FILE:
                                        $page = new ImagePage( $title );
                                        break;
@@ -609,7 +609,7 @@ class Article implements Page {
                $this->mParserOutput = false;
 
                while ( !$outputDone && ++$pass ) {
-                       switch( $pass ) {
+                       switch ( $pass ) {
                                case 1:
                                        wfRunHooks( 'ArticleViewHeader', array( &$this, &$outputDone, &$useParserCache ) );
                                        break;
@@ -1100,7 +1100,7 @@ class Article implements Page {
                        $user = User::newFromName( $rootPart, false /* allow IP users*/ );
                        $ip = User::isIP( $rootPart );
 
-                       if ( !($user && $user->isLoggedIn()) && !$ip ) { # User does not exist
+                       if ( !( $user && $user->isLoggedIn() ) && !$ip ) { # User does not exist
                                $outputPage->wrapWikiMsg( "<div class=\"mw-userpage-userdoesnotexist error\">\n\$1\n</div>",
                                        array( 'userpage-userdoesnotexist-view', wfEscapeWikiText( $rootPart ) ) );
                        } elseif ( $user->isBlocked() ) { # Show log extract if the user is currently blocked
index 604b924..ec9dcf5 100644 (file)
@@ -165,7 +165,7 @@ class Autopromote {
                        return false;
                }
 
-               switch( $cond[0] ) {
+               switch ( $cond[0] ) {
                        case APCOND_EMAILCONFIRMED:
                                if ( Sanitizer::validateEmail( $user->getEmail() ) ) {
                                        if ( $wgEmailAuthentication ) {
index eab1754..47ddc7d 100644 (file)
@@ -249,7 +249,7 @@ class Block {
                # passed by some callers (bug 29116)
                if ( $vagueTarget != '' ) {
                        list( $target, $type ) = self::parseTarget( $vagueTarget );
-                       switch( $type ) {
+                       switch ( $type ) {
                                case self::TYPE_USER:
                                        # Slightly weird, but who are we to argue?
                                        $conds['ipb_address'][] = (string)$target;
@@ -511,7 +511,7 @@ class Block {
         * @return Array
         */
        protected function getDatabaseArray( $db = null ) {
-               if( !$db ) {
+               if ( !$db ) {
                        $db = wfGetDB( DB_SLAVE );
                }
                $expiry = $db->encodeExpiry( $this->mExpiry );
@@ -795,7 +795,7 @@ class Block {
         * @return String IP in Hex form
         */
        public function getRangeStart() {
-               switch( $this->type ) {
+               switch ( $this->type ) {
                        case self::TYPE_USER:
                                return '';
                        case self::TYPE_IP:
@@ -814,7 +814,7 @@ class Block {
         * @return String IP in Hex form
         */
        public function getRangeEnd() {
-               switch( $this->type ) {
+               switch ( $this->type ) {
                        case self::TYPE_USER:
                                return '';
                        case self::TYPE_IP:
@@ -911,7 +911,7 @@ class Block {
         * @return Bool
         */
        public function prevents( $action, $x = null ) {
-               switch( $action ) {
+               switch ( $action ) {
                        case 'edit':
                                # For now... <evil laugh>
                                return true;
@@ -1173,7 +1173,7 @@ class Block {
         * @param Array $block Array of blocks
         * @return Block|null the "best" block from the list
         */
-       public static function chooseBlock( array $blocks, array $ipChain  ) {
+       public static function chooseBlock( array $blocks, array $ipChain ) {
                if ( !count( $blocks ) ) {
                        return null;
                } elseif ( count( $blocks ) == 1 ) {
index 0a5cb68..530b094 100644 (file)
@@ -290,7 +290,7 @@ class FormOptions implements ArrayAccess {
                        $default = $this->options[$name]['default'];
                        $type = $this->options[$name]['type'];
 
-                       switch( $type ) {
+                       switch ( $type ) {
                                case self::BOOL:
                                        $value = $r->getBool( $name, $default );
                                        break;
index a81a338..320a57d 100644 (file)
@@ -3760,7 +3760,7 @@ function wfShorthandToInteger( $string = '' ) {
        }
        $last = $string[strlen( $string ) - 1];
        $val = intval( $string );
-       switch( $last ) {
+       switch ( $last ) {
                case 'g':
                case 'G':
                        $val *= 1024;
index 28daf91..2da368c 100644 (file)
@@ -280,7 +280,7 @@ class MWHttpRequest {
                                ' Http::$httpEngine is set to "curl"' );
                }
 
-               switch( Http::$httpEngine ) {
+               switch ( Http::$httpEngine ) {
                        case 'curl':
                                return new CurlHttpRequest( $url, $options );
                        case 'php':
index 8220287..bf5a3fb 100644 (file)
@@ -381,7 +381,7 @@ class WikiImporter {
                }
                $buffer = "";
                while ( $this->reader->read() ) {
-                       switch( $this->reader->nodeType ) {
+                       switch ( $this->reader->nodeType ) {
                        case XmlReader::TEXT:
                        case XmlReader::SIGNIFICANT_WHITESPACE:
                                $buffer .= $this->reader->value;
@@ -424,7 +424,7 @@ class WikiImporter {
                        $lookup = array();
 
                        foreach ( $xmlReaderConstants as $name ) {
-                               $lookup[constant("XmlReader::$name")] = $name;
+                               $lookup[constant( "XmlReader::$name" )] = $name;
                        }
                }
 
@@ -1002,7 +1002,7 @@ class XMLReader2 extends XMLReader {
                }
                $buffer = "";
                while ( $this->read() ) {
-                       switch( $this->nodeType ) {
+                       switch ( $this->nodeType ) {
                        case XmlReader::TEXT:
                        case XmlReader::SIGNIFICANT_WHITESPACE:
                                $buffer .= $this->value;
@@ -1657,7 +1657,7 @@ class ImportStreamSource {
                        return Status::newFatal( 'importnofile' );
                }
                if ( !empty( $upload['error'] ) ) {
-                       switch( $upload['error'] ) {
+                       switch ( $upload['error'] ) {
                                case 1: # The uploaded file exceeds the upload_max_filesize directive in php.ini.
                                        return Status::newFatal( 'importuploaderrorsize' );
                                case 2: # The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.
index 1627b3d..44fafca 100644 (file)
@@ -642,7 +642,7 @@ class MimeMagic {
                }
 
                /* Look for WebP */
-               if ( strncmp( $head, "RIFF", 4 ) == 0 && strncmp( substr( $head, 8, 8), "WEBPVP8 ", 8 ) == 0 ) {
+               if ( strncmp( $head, "RIFF", 4 ) == 0 && strncmp( substr( $head, 8, 8 ), "WEBPVP8 ", 8 ) == 0 ) {
                        wfDebug( __METHOD__ . ": recognized file as image/webp\n" );
                        return "image/webp";
                }
@@ -815,12 +815,12 @@ class MimeMagic {
                        }
                        wfDebug( __METHOD__ . ": detected an Open Packaging Conventions archive: $mime\n" );
                } elseif ( substr( $header, 0, 8 ) == "\xd0\xcf\x11\xe0\xa1\xb1\x1a\xe1" &&
-                               ($headerpos = strpos( $tail, "PK\x03\x04" ) ) !== false &&
+                               ( $headerpos = strpos( $tail, "PK\x03\x04" ) ) !== false &&
                                preg_match( $openxmlRegex, substr( $tail, $headerpos + 30 ) ) ) {
                        if ( substr( $header, 512, 4 ) == "\xEC\xA5\xC1\x00" ) {
                                $mime = "application/msword";
                        }
-                       switch( substr( $header, 512, 6 ) ) {
+                       switch ( substr( $header, 512, 6 ) ) {
                                case "\xEC\xA5\xC1\x00\x0E\x00":
                                case "\xEC\xA5\xC1\x00\x1C\x00":
                                case "\xEC\xA5\xC1\x00\x43\x00":
index 9b9485e..ae65b9d 100644 (file)
@@ -694,7 +694,7 @@ class LegacyTemplate extends BaseTemplate {
 
                if ( $title->isTalkPage() ) {
                        $link = $title->getSubjectPage();
-                       switch( $link->getNamespace() ) {
+                       switch ( $link->getNamespace() ) {
                                case NS_MAIN:
                                        $text = wfMessage( 'articlepage' );
                                        break;
index 17c7808..e53d424 100644 (file)
@@ -1827,7 +1827,7 @@ abstract class BaseTemplate extends QuickTemplate {
        }
 
        function makeSearchButton( $mode, $attrs = array() ) {
-               switch( $mode ) {
+               switch ( $mode ) {
                        case 'go':
                        case 'fulltext':
                                $realAttrs = array(
index b5dd6de..739c52a 100644 (file)
@@ -757,7 +757,7 @@ class Title {
         */
        public function getTalkNsText() {
                global $wgContLang;
-               return( $wgContLang->getNsText( MWNamespace::getTalk( $this->mNamespace ) ) );
+               return $wgContLang->getNsText( MWNamespace::getTalk( $this->mNamespace ) );
        }
 
        /**
@@ -766,7 +766,7 @@ class Title {
         * @return Bool TRUE or FALSE
         */
        public function canTalk() {
-               return( MWNamespace::canTalk( $this->mNamespace ) );
+               return MWNamespace::canTalk( $this->mNamespace );
        }
 
        /**
@@ -1275,10 +1275,10 @@ class Title {
         */
        public function getSubpageText() {
                if ( !MWNamespace::hasSubpages( $this->mNamespace ) ) {
-                       return( $this->mTextform );
+                       return $this->mTextform;
                }
                $parts = explode( '/', $this->mTextform );
-               return( $parts[count( $parts ) - 1] );
+               return $parts[count( $parts ) - 1];
        }
 
        /**
@@ -1318,7 +1318,7 @@ class Title {
        public function getSubpageUrlForm() {
                $text = $this->getSubpageText();
                $text = wfUrlencode( str_replace( ' ', '_', $text ) );
-               return( $text );
+               return $text;
        }
 
        /**
@@ -4401,7 +4401,7 @@ class Title {
                        return true;  // any interwiki link might be viewable, for all we know
                }
 
-               switch( $this->mNamespace ) {
+               switch ( $this->mNamespace ) {
                        case NS_MEDIA:
                        case NS_FILE:
                                // file exists, possibly in a foreign repo
index ab60008..e7e5e1d 100644 (file)
@@ -262,7 +262,7 @@ class ApiEditPage extends ApiBase {
                        $requestArray['wpStarttime'] = wfTimestampNow(); // Fake wpStartime
                }
 
-               if ( $params['minor'] || ( !$params['notminor'] && $user->getOption( 'minordefault' ) ) )       {
+               if ( $params['minor'] || ( !$params['notminor'] && $user->getOption( 'minordefault' ) ) ) {
                        $requestArray['wpMinoredit'] = '';
                }
 
@@ -342,7 +342,7 @@ class ApiEditPage extends ApiBase {
                $wgRequest = $oldRequest;
                global $wgMaxArticleSize;
 
-               switch( $status->value ) {
+               switch ( $status->value ) {
                        case EditPage::AS_HOOK_ERROR:
                        case EditPage::AS_HOOK_ERROR_EXPECTED:
                                $this->dieUsageMsg( 'hookaborted' );
index f9b85ef..4ec149c 100644 (file)
@@ -155,7 +155,7 @@ class ApiFormatXml extends ApiFormatBase {
                                        unset( $elemValue[$subElemId] );
                                } elseif ( is_array( $subElemValue ) ) {
                                        $subElements[$subElemId] = $subElemValue;
-                                       unset ( $elemValue[$subElemId] );
+                                       unset( $elemValue[$subElemId] );
                                }
                        }
 
index 0645edb..3caf81f 100644 (file)
@@ -188,7 +188,7 @@ class ApiPageSet extends ApiBase {
 
                        if ( !$isDryRun ) {
                                // Populate page information with the original user input
-                               switch( $dataSource ) {
+                               switch ( $dataSource ) {
                                        case 'titles':
                                                $this->initFromTitles( $this->mParams['titles'] );
                                                break;
@@ -407,7 +407,7 @@ class ApiPageSet extends ApiBase {
         * @return array of raw_prefixed_title (string) => prefixed_title (string)
         * @since 1.21
         */
-       public function getNormalizedTitlesAsResult( $result = null  ) {
+       public function getNormalizedTitlesAsResult( $result = null ) {
                $values = array();
                foreach ( $this->getNormalizedTitles() as $rawTitleStr => $titleStr ) {
                        $values[] = array(
index 8aceab2..7cb445d 100644 (file)
@@ -499,7 +499,7 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase {
                        }
                        return $retval;
                }
-               switch( $type ) {
+               switch ( $type ) {
                        case 'edit':
                                return RC_EDIT;
                        case 'new':
index a8d7115..5563087 100644 (file)
@@ -456,7 +456,7 @@ class ApiUpload extends ApiBase {
                global $wgFileExtensions;
 
                // @todo Move them to ApiBase's message map
-               switch( $verification['status'] ) {
+               switch ( $verification['status'] ) {
                        // Recoverable errors
                        case UploadBase::MIN_LENGTH_PARTNAME:
                                $this->dieRecoverableError( 'filename-tooshort', 'filename' );
index 427fd3d..da719be 100644 (file)
@@ -1049,7 +1049,7 @@ class MssqlResult {
                                $arrNum[] = $value;
                        }
                }
-               switch( $mode ) {
+               switch ( $mode ) {
                        case SQLSRV_FETCH_ASSOC:
                                $ret = $this->mRows[$this->mCursor];
                                break;
index a3f6805..3333f4a 100644 (file)
@@ -677,7 +677,7 @@ class DatabaseOracle extends DatabaseBase {
                Using uppercase because that's the only way Oracle can handle
                quoted tablenames
                */
-               switch( $name ) {
+               switch ( $name ) {
                        case 'user':
                                $name = 'MWUSER';
                                break;
index 704b70e..e12175f 100644 (file)
@@ -915,7 +915,7 @@ __INDEXATTR__;
 
        function tableName( $name, $format = 'quoted' ) {
                # Replace reserved words with better ones
-               switch( $name ) {
+               switch ( $name ) {
                        case 'user':
                                return $this->realTableName( 'mwuser', $format );
                        case 'text':
index e78045a..4435fc6 100644 (file)
@@ -1111,7 +1111,7 @@ class ArrayDiffFormatter extends DiffFormatter {
                $newline = 1;
                $retval = array();
                foreach ( $diff->edits as $edit ) {
-                       switch( $edit->type ) {
+                       switch ( $edit->type ) {
                                case 'add':
                                        foreach ( $edit->closing as $l ) {
                                                $retval[] = array(
index d3dfc83..cd7e53c 100644 (file)
@@ -222,7 +222,7 @@ class LocalSettingsGenerator {
                        }
                }
 
-               switch( $this->values['wgMainCacheType'] ) {
+               switch ( $this->values['wgMainCacheType'] ) {
                        case 'anything':
                        case 'db':
                        case 'memcached':
index 27526f5..8f60aee 100644 (file)
@@ -194,9 +194,9 @@ class LogFormatter {
                // Text of title the action is aimed at.
                $target = $entry->getTarget()->getPrefixedText();
                $text = null;
-               switch( $entry->getType() ) {
+               switch ( $entry->getType() ) {
                        case 'move':
-                               switch( $entry->getSubtype() ) {
+                               switch ( $entry->getSubtype() ) {
                                        case 'move':
                                                $movesource = $parameters['4::target'];
                                                $text = wfMessage( '1movedto2' )
@@ -215,7 +215,7 @@ class LogFormatter {
                                break;
 
                        case 'delete':
-                               switch( $entry->getSubtype() ) {
+                               switch ( $entry->getSubtype() ) {
                                        case 'delete':
                                                $text = wfMessage( 'deletedarticle' )
                                                        ->rawParams( $target )->inContentLanguage()->escaped();
@@ -246,7 +246,7 @@ class LogFormatter {
                                break;
 
                        case 'protect':
-                               switch( $entry->getSubtype() ) {
+                               switch ( $entry->getSubtype() ) {
                                case 'protect':
                                        $text = wfMessage( 'protectedarticle' )
                                                ->rawParams( $target . ' ' . $parameters[0] )->inContentLanguage()->escaped();
@@ -263,7 +263,7 @@ class LogFormatter {
                                break;
 
                        case 'newusers':
-                               switch( $entry->getSubtype() ) {
+                               switch ( $entry->getSubtype() ) {
                                        case 'newusers':
                                        case 'create':
                                                $text = wfMessage( 'newuserlog-create-entry' )
@@ -282,7 +282,7 @@ class LogFormatter {
                                break;
 
                        case 'upload':
-                               switch( $entry->getSubtype() ) {
+                               switch ( $entry->getSubtype() ) {
                                        case 'upload':
                                                $text = wfMessage( 'uploadedimage' )
                                                        ->rawParams( $target )->inContentLanguage()->escaped();
@@ -305,7 +305,7 @@ class LogFormatter {
                                } else {
                                        $newgroups = wfMessage( 'rightsnone' )->inContentLanguage()->escaped();
                                }
-                               switch( $entry->getSubtype() ) {
+                               switch ( $entry->getSubtype() ) {
                                        case 'rights':
                                                $text = wfMessage( 'rightslogentry' )
                                                        ->rawParams( $target, $oldgroups, $newgroups )->inContentLanguage()->escaped();
@@ -479,7 +479,7 @@ class LogFormatter {
        protected function formatParameterValue( $type, $value ) {
                $saveLinkFlood = $this->linkFlood;
 
-               switch( strtolower( trim( $type ) ) ) {
+               switch ( strtolower( trim( $type ) ) ) {
                        case 'raw':
                                $value = Message::rawParam( $value );
                                break;
index 3fe91fc..9d6ab25 100644 (file)
@@ -331,7 +331,7 @@ class LogPage {
                        return $title->getPrefixedText();
                }
 
-               switch( $type ) {
+               switch ( $type ) {
                        case 'move':
                                $titleLink = Linker::link(
                                        $title,
index 555a414..7c39c81 100644 (file)
@@ -292,7 +292,7 @@ class BitmapMetadataHandler {
                $head = fread( $fh, 2 );
                fclose( $fh );
 
-               switch( $head ) {
+               switch ( $head ) {
                        case 'II':
                                return 'LE'; // II for intel.
                        case 'MM':
index 3d153eb..276af4d 100644 (file)
@@ -127,9 +127,9 @@ class FormatMetadata {
 
                        foreach ( $vals as &$val ) {
 
-                               switch( $tag ) {
+                               switch ( $tag ) {
                                case 'Compression':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 1: case 2: case 3: case 4:
                                        case 5: case 6: case 7: case 8:
                                        case 32773: case 32946: case 34712:
@@ -142,7 +142,7 @@ class FormatMetadata {
                                        break;
 
                                case 'PhotometricInterpretation':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 2: case 6:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -153,7 +153,7 @@ class FormatMetadata {
                                        break;
 
                                case 'Orientation':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -164,7 +164,7 @@ class FormatMetadata {
                                        break;
 
                                case 'PlanarConfiguration':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 1: case 2:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -189,7 +189,7 @@ class FormatMetadata {
 
                                case 'XResolution':
                                case 'YResolution':
-                                       switch( $resolutionunit ) {
+                                       switch ( $resolutionunit ) {
                                                case 2:
                                                        $val = self::msg( 'XYResolution', 'i', self::formatNum( $val ) );
                                                        break;
@@ -208,7 +208,7 @@ class FormatMetadata {
                                        break;
 
                                case 'ColorSpace':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 1: case 65535:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -219,7 +219,7 @@ class FormatMetadata {
                                        break;
 
                                case 'ComponentsConfiguration':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 0: case 1: case 2: case 3: case 4: case 5: case 6:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -267,7 +267,7 @@ class FormatMetadata {
                                        break;
 
                                case 'ExposureProgram':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -282,7 +282,7 @@ class FormatMetadata {
                                        break;
 
                                case 'MeteringMode':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 255:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -293,7 +293,7 @@ class FormatMetadata {
                                        break;
 
                                case 'LightSource':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 0: case 1: case 2: case 3: case 4: case 9: case 10: case 11:
                                        case 12: case 13: case 14: case 15: case 17: case 18: case 19: case 20:
                                        case 21: case 22: case 23: case 24: case 255:
@@ -328,7 +328,7 @@ class FormatMetadata {
                                        break;
 
                                case 'FocalPlaneResolutionUnit':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 2:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -339,7 +339,7 @@ class FormatMetadata {
                                        break;
 
                                case 'SensingMethod':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 1: case 2: case 3: case 4: case 5: case 7: case 8:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -350,7 +350,7 @@ class FormatMetadata {
                                        break;
 
                                case 'FileSource':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 3:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -361,7 +361,7 @@ class FormatMetadata {
                                        break;
 
                                case 'SceneType':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 1:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -372,7 +372,7 @@ class FormatMetadata {
                                        break;
 
                                case 'CustomRendered':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 0: case 1:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -383,7 +383,7 @@ class FormatMetadata {
                                        break;
 
                                case 'ExposureMode':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 0: case 1: case 2:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -394,7 +394,7 @@ class FormatMetadata {
                                        break;
 
                                case 'WhiteBalance':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 0: case 1:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -405,7 +405,7 @@ class FormatMetadata {
                                        break;
 
                                case 'SceneCaptureType':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 0: case 1: case 2: case 3:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -416,7 +416,7 @@ class FormatMetadata {
                                        break;
 
                                case 'GainControl':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 0: case 1: case 2: case 3: case 4:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -427,7 +427,7 @@ class FormatMetadata {
                                        break;
 
                                case 'Contrast':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 0: case 1: case 2:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -438,7 +438,7 @@ class FormatMetadata {
                                        break;
 
                                case 'Saturation':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 0: case 1: case 2:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -449,7 +449,7 @@ class FormatMetadata {
                                        break;
 
                                case 'Sharpness':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 0: case 1: case 2:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -460,7 +460,7 @@ class FormatMetadata {
                                        break;
 
                                case 'SubjectDistanceRange':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 0: case 1: case 2: case 3:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -473,7 +473,7 @@ class FormatMetadata {
                                //The GPS...Ref values are kept for compatibility, probably won't be reached.
                                case 'GPSLatitudeRef':
                                case 'GPSDestLatitudeRef':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 'N': case 'S':
                                                $val = self::msg( 'GPSLatitude', $val );
                                                break;
@@ -485,7 +485,7 @@ class FormatMetadata {
 
                                case 'GPSLongitudeRef':
                                case 'GPSDestLongitudeRef':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 'E': case 'W':
                                                $val = self::msg( 'GPSLongitude', $val );
                                                break;
@@ -504,7 +504,7 @@ class FormatMetadata {
                                        break;
 
                                case 'GPSStatus':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 'A': case 'V':
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -515,7 +515,7 @@ class FormatMetadata {
                                        break;
 
                                case 'GPSMeasureMode':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 2: case 3:
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -528,7 +528,7 @@ class FormatMetadata {
                                case 'GPSTrackRef':
                                case 'GPSImgDirectionRef':
                                case 'GPSDestBearingRef':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 'T': case 'M':
                                                $val = self::msg( 'GPSDirection', $val );
                                                break;
@@ -548,7 +548,7 @@ class FormatMetadata {
                                        break;
 
                                case 'GPSSpeedRef':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 'K': case 'M': case 'N':
                                                $val = self::msg( 'GPSSpeed', $val );
                                                break;
@@ -559,7 +559,7 @@ class FormatMetadata {
                                        break;
 
                                case 'GPSDestDistanceRef':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 'K': case 'M': case 'N':
                                                $val = self::msg( 'GPSDestDistance', $val );
                                                break;
@@ -646,7 +646,7 @@ class FormatMetadata {
                                        break;
 
                                case 'iimCategory':
-                                       switch( strtolower( $val ) ) {
+                                       switch ( strtolower( $val ) ) {
                                                // See pg 29 of IPTC photo
                                                // metadata standard.
                                                case 'ace': case 'clj':
@@ -791,7 +791,7 @@ class FormatMetadata {
                                        }
                                        break;
                                case 'Copyrighted':
-                                       switch( $val ) {
+                                       switch ( $val ) {
                                        case 'True': case 'False':
                                                $val = self::msg( $tag, $val );
                                                break;
@@ -863,7 +863,7 @@ class FormatMetadata {
                 */
                else {
                        global $wgContLang;
-                       switch( $type ) {
+                       switch ( $type ) {
                        case 'lang':
                                // Display default, followed by ContLang,
                                // followed by the rest in no particular
@@ -948,7 +948,7 @@ class FormatMetadata {
         * this is treated as wikitext not html).
         */
        private static function langItem( $value, $lang, $default = false, $noHtml = false ) {
-               if ( $lang === false && $default === false) {
+               if ( $lang === false && $default === false ) {
                        throw new MWException( '$lang and $default cannot both '
                                . 'be false.' );
                }
@@ -1125,7 +1125,7 @@ class FormatMetadata {
                        return $val;
                }
                $cat = '';
-               switch( substr( $val, 0, 2 ) ) {
+               switch ( substr( $val, 0, 2 ) ) {
                        case '01':
                                $cat = 'ace';
                                break;
index 6e04b3d..544dd21 100644 (file)
@@ -63,7 +63,7 @@ class IPTC {
                                wfDebugLog( 'iptc', "IPTC tag $tag had only whitespace as its value." );
                                continue;
                        }
-                       switch( $tag ) {
+                       switch ( $tag ) {
                                case '2#120': /*IPTC caption. mapped with exif ImageDescription*/
                                        $data['ImageDescription'] = self::convIPTC( $val, $c );
                                        break;
index c9a20f2..948a0f8 100644 (file)
@@ -144,7 +144,7 @@ class SVGReader {
                while ( $keepReading ) {
                        $tag = $this->reader->localName;
                        $type = $this->reader->nodeType;
-                       $isSVG = ($this->reader->namespaceURI == self::NS_SVG);
+                       $isSVG = ( $this->reader->namespaceURI == self::NS_SVG );
 
                        $this->debug( "$tag" );
 
@@ -241,7 +241,7 @@ class SVGReader {
                                && $this->reader->nodeType == XmlReader::END_ELEMENT ) {
                                break;
                        } elseif ( $this->reader->namespaceURI == self::NS_SVG && $this->reader->nodeType == XmlReader::ELEMENT ) {
-                               switch( $this->reader->localName ) {
+                               switch ( $this->reader->localName ) {
                                        case 'script':
                                                // Normally we disallow files with
                                                // <script>, but its possible
index b2b95e4..7eb3d19 100644 (file)
@@ -641,7 +641,7 @@ class XMPReader {
                        throw new MWException( "Hit end element </$elm> but no curItem" );
                }
 
-               switch( $this->mode[0] ) {
+               switch ( $this->mode[0] ) {
                        case self::MODE_IGNORE:
                                $this->endElementModeIgnore( $elm );
                                break;
@@ -1060,7 +1060,7 @@ class XMPReader {
                                . "encountered <$elm> with no mode" );
                }
 
-               switch( $this->mode[0] ) {
+               switch ( $this->mode[0] ) {
                        case self::MODE_IGNORE:
                                $this->startElementModeIgnore( $elm );
                                break;
index 7db6fab..e6342e4 100644 (file)
@@ -187,7 +187,7 @@ class CoreParserFunctions {
                if ( is_null( $magicWords ) ) {
                        $magicWords = new MagicWordArray( array( 'url_path', 'url_query', 'url_wiki' ) );
                }
-               switch( $magicWords->matchStartToEnd( $arg ) ) {
+               switch ( $magicWords->matchStartToEnd( $arg ) ) {
 
                        // Encode as though it's a wiki page, '_' for ' '.
                        case 'url_wiki':
@@ -440,7 +440,7 @@ class CoreParserFunctions {
        static function pagesinnamespace( $parser, $namespace = 0, $raw = null ) {
                return self::formatRaw( SiteStats::pagesInNs( intval( $namespace ) ), $raw );
        }
-       static function numberingroup( $parser, $name = '', $raw = null) {
+       static function numberingroup( $parser, $name = '', $raw = null ) {
                return self::formatRaw( SiteStats::numberingroup( strtolower( $name ) ), $raw );
        }
 
@@ -834,9 +834,9 @@ class CoreParserFunctions {
                if ( $old === false || $old == $text || $arg ) {
                        return '';
                } else {
-                       return( '<span class="error">' .
+                       return '<span class="error">' .
                                wfMessage( 'duplicate-defaultsort', $old, $text )->inContentLanguage()->escaped() .
-                               '</span>' );
+                               '</span>';
                }
        }
 
index ab69256..47a09c4 100644 (file)
@@ -2510,10 +2510,10 @@ class Parser {
                for ( $i = 0; $i < $len; $i++ ) {
                        $c = $str[$i];
 
-                       switch( $state ) {
+                       switch ( $state ) {
                        # (Using the number is a performance hack for common cases)
                        case 0: # self::COLON_STATE_TEXT:
-                               switch( $c ) {
+                               switch ( $c ) {
                                case "<":
                                        # Could be either a <start> tag or an </end> tag
                                        $state = self::COLON_STATE_TAGSTART;
@@ -2558,7 +2558,7 @@ class Parser {
                                break;
                        case 1: # self::COLON_STATE_TAG:
                                # In a <tag>
-                               switch( $c ) {
+                               switch ( $c ) {
                                case ">":
                                        $stack++;
                                        $state = self::COLON_STATE_TEXT;
@@ -2572,7 +2572,7 @@ class Parser {
                                }
                                break;
                        case 2: # self::COLON_STATE_TAGSTART:
-                               switch( $c ) {
+                               switch ( $c ) {
                                case "/":
                                        $state = self::COLON_STATE_CLOSETAG;
                                        break;
@@ -4670,7 +4670,7 @@ class Parser {
         * @return mixed An expanded string, or false if invalid.
         */
        function validateSig( $text ) {
-               return( Xml::isWellFormedXmlFragment( $text ) ? $text : false );
+               return Xml::isWellFormedXmlFragment( $text ) ? $text : false;
        }
 
        /**
@@ -5236,7 +5236,7 @@ class Parser {
                                                $validated = $handler->validateParam( $paramName, $value );
                                        } else {
                                                # Validate internal parameters
-                                               switch( $paramName ) {
+                                               switch ( $paramName ) {
                                                case 'manualthumb':
                                                case 'alt':
                                                case 'class':
index de9e99c..13e8a00 100644 (file)
@@ -93,7 +93,7 @@ class SearchEngine {
         * @return Boolean
         */
        public function supports( $feature ) {
-               switch( $feature ) {
+               switch ( $feature ) {
                case 'list-redirects':
                        return true;
                case 'title-suffix-filter':
index f63931d..c219b92 100644 (file)
@@ -211,7 +211,7 @@ class SearchMySQL extends SearchEngine {
        }
 
        public function supports( $feature ) {
-               switch( $feature ) {
+               switch ( $feature ) {
                case 'list-redirects':
                case 'title-suffix-filter':
                        return true;
index b2b2946..4da5155 100644 (file)
@@ -57,7 +57,7 @@ class SpecialUnblock extends SpecialPage {
                $form->addPreText( $this->msg( 'unblockiptext' )->parseAsBlock() );
 
                if ( $form->show() ) {
-                       switch( $this->type ) {
+                       switch ( $this->type ) {
                                case Block::TYPE_USER:
                                case Block::TYPE_IP:
                                        $out->addWikiMsg( 'unblocked', wfEscapeWikiText( $this->target ) );
@@ -106,7 +106,7 @@ class SpecialUnblock extends SpecialPage {
                        } else {
                                $fields['Target']['default'] = $target;
                                $fields['Target']['type'] = 'hidden';
-                               switch( $type ) {
+                               switch ( $type ) {
                                        case Block::TYPE_USER:
                                        case Block::TYPE_IP:
                                                $fields['Name']['default'] = Linker::link(
index 6fb133a..ee737c6 100644 (file)
@@ -530,7 +530,7 @@ class SpecialUpload extends SpecialPage {
        protected function processVerificationError( $details ) {
                global $wgFileExtensions;
 
-               switch( $details['status'] ) {
+               switch ( $details['status'] ) {
 
                        /** Statuses that only require name changing **/
                        case UploadBase::MIN_LENGTH_PARTNAME:
index ff4313f..0296a63 100644 (file)
@@ -76,7 +76,7 @@ class SpecialWatchlist extends SpecialPage {
                $mode = SpecialEditWatchlist::getMode( $request, $par );
                if ( $mode !== false ) {
                        # TODO: localise?
-                       switch( $mode ) {
+                       switch ( $mode ) {
                                case SpecialEditWatchlist::EDIT_CLEAR:
                                        $mode = 'clear';
                                        break;
@@ -163,7 +163,7 @@ class SpecialWatchlist extends SpecialPage {
                        $big = 1000; /* The magical big */
                        if ( $nitems > $big ) {
                                # Set default cutoff shorter
-                               $values['days'] = $defaults['days'] = (12.0 / 24.0); # 12 hours...
+                               $values['days'] = $defaults['days'] = ( 12.0 / 24.0 ); # 12 hours...
                        } else {
                                $values['days'] = $defaults['days']; # default cutoff for shortlisters
                        }
index 9651f3d..ff87f89 100644 (file)
@@ -1822,7 +1822,7 @@ class Language {
                }
                $start = substr( $str, 0, strlen( $str ) - 2 );
                $end = substr( $str, strlen( $str ) - 2 );
-               switch( $end ) {
+               switch ( $end ) {
                        case 'כ':
                                $str = $start . 'ך';
                                break;
index c8c06f3..c0bdc3f 100644 (file)
@@ -303,7 +303,7 @@ class KkConverter extends LanguageConverter {
                global $wgLanguageCode;
                $text = parent::translate( $text, $toVariant );
 
-               switch( $toVariant ) {
+               switch ( $toVariant ) {
                        case 'kk-cyrl':
                        case 'kk-kz':
                                $letters = KK_L_UC . KK_L_LC . 'ʺʹ#0123456789';
@@ -347,7 +347,7 @@ class KkConverter extends LanguageConverter {
                        return $text;
                }
 
-               switch( $toVariant ) {
+               switch ( $toVariant ) {
                        case 'kk-arab':
                        case 'kk-cn':
                                $letters = KK_C_LC . KK_C_UC/*.KK_L_LC.KK_L_UC*/;
index 9163d69..bcd59f1 100644 (file)
@@ -133,7 +133,7 @@ class BackupDumper {
                        $matches = array();
                        if ( preg_match( '/^--(.+?)(?:=(.+?)(?::(.+?))?)?$/', $arg, $matches ) ) {
                                @list( /* $full */ , $opt, $val, $param ) = $matches;
-                               switch( $opt ) {
+                               switch ( $opt ) {
                                case "plugin":
                                        $this->loadPlugin( $val, $param );
                                        break;
@@ -368,7 +368,7 @@ class BackupDumper {
 
        function fatalError( $msg ) {
                $this->progress( "$msg\n" );
-               die(1);
+               die( 1 );
        }
 }
 
index cc0a7e1..04352b9 100644 (file)
@@ -51,7 +51,7 @@ class BaseDump {
                $this->infiles = explode( ';', $infile );
                $this->reader = new XMLReader();
                $infile = array_shift( $this->infiles );
-               if (defined( 'LIBXML_PARSEHUGE' ) ) {
+               if ( defined( 'LIBXML_PARSEHUGE' ) ) {
                        $this->reader->open( $infile, null, LIBXML_PARSEHUGE );
                }
                else {
@@ -110,8 +110,8 @@ class BaseDump {
                        }
                } else {
                        $this->close();
-                       if (count($this->infiles)) {
-                               $infile = array_shift($this->infiles);
+                       if ( count( $this->infiles ) ) {
+                               $infile = array_shift( $this->infiles );
                                $this->reader->open( $infile );
                                $this->atEnd = false;
                        }
@@ -181,7 +181,7 @@ class BaseDump {
                }
                $buffer = "";
                while ( $this->reader->read() ) {
-                       switch( $this->reader->nodeType ) {
+                       switch ( $this->reader->nodeType ) {
                        case XMLReader::TEXT:
 //                     case XMLReader::WHITESPACE:
                        case XMLReader::SIGNIFICANT_WHITESPACE:
index c99f004..547abab 100644 (file)
@@ -183,7 +183,7 @@ class TextPassDumper extends BackupDumper {
                global $IP;
                $url = $this->processFileOpt( $val, $param );
 
-               switch( $opt ) {
+               switch ( $opt ) {
                case 'prefetch':
                        require_once "$IP/maintenance/backupPrefetch.inc";
                        $this->prefetch = new BaseDump( $url );
@@ -215,7 +215,7 @@ class TextPassDumper extends BackupDumper {
        function processFileOpt( $val, $param ) {
                $fileURIs = explode( ';', $param );
                foreach ( $fileURIs as $URI ) {
-                       switch( $val ) {
+                       switch ( $val ) {
                                case "file":
                                        $newURI = $URI;
                                        break;
index 83b5b02..53ea597 100644 (file)
@@ -53,7 +53,7 @@ class GetConfiguration extends Maintenance {
                }
 
                $out = null;
-               switch( $this->getOption( 'format' ) ) {
+               switch ( $this->getOption( 'format' ) ) {
                        case 'PHP':
                                $out = serialize( $res );
                                break;
index 413d650..9e583e7 100644 (file)
@@ -46,7 +46,7 @@ class CheckLanguageCLI {
        public function __construct( array $options ) {
                if ( isset( $options['help'] ) ) {
                        echo $this->help();
-                       exit(1);
+                       exit( 1 );
                }
 
                if ( isset( $options['lang'] ) ) {
@@ -488,7 +488,7 @@ class CheckExtensionsCLI extends CheckLanguageCLI {
        public function __construct( array $options, $extension ) {
                if ( isset( $options['help'] ) ) {
                        echo $this->help();
-                       exit(1);
+                       exit( 1 );
                }
 
                if ( isset( $options['lang'] ) ) {
@@ -654,7 +654,7 @@ ENDS;
                                echo $extension->name() . ":\n";
 
                                if ( $this->level > 0 ) {
-                                       switch( $this->output ) {
+                                       switch ( $this->output ) {
                                                case 'plain':
                                                        $this->outputText();
                                                        break;
index 6148cc4..8aac4b3 100644 (file)
@@ -145,8 +145,8 @@ function generateConfigFile( $doxygenTemplate, $outputDirectory, $stripFromPath,
 unset( $file );
 
 if ( is_array( $argv ) ) {
-       for ($i = 0; $i < count($argv); $i++ ) {
-               switch( $argv[$i] ) {
+       for ( $i = 0; $i < count( $argv ); $i++ ) {
+               switch ( $argv[$i] ) {
                case '--all':
                        $input = 0;
                        break;
@@ -210,7 +210,7 @@ Other options:
 
 
 END;
-                       exit(0);
+                       exit( 0 );
                        break;
                }
        }
index f8d55c5..1e4643e 100644 (file)
@@ -187,7 +187,7 @@ class VectorTemplate extends BaseTemplate {
                                <?php } ?>
                                <?php if ( $this->data['newtalk'] ) { ?>
                                <!-- newtalk -->
-                               <div class="usermessage"><?php $this->html( 'newtalk' )  ?></div>
+                               <div class="usermessage"><?php $this->html( 'newtalk' ) ?></div>
                                <!-- /newtalk -->
                                <?php } ?>
                                <?php if ( $this->data['showjumplinks'] ) { ?>
@@ -304,7 +304,7 @@ class VectorTemplate extends BaseTemplate {
                        }
 
                        echo "\n<!-- {$name} -->\n";
-                       switch( $name ) {
+                       switch ( $name ) {
                                case 'SEARCH':
                                        break;
                                case 'TOOLBOX':
@@ -381,7 +381,7 @@ class VectorTemplate extends BaseTemplate {
                // Render elements
                foreach ( $elements as $name => $element ) {
                        echo "\n<!-- {$name} -->\n";
-                       switch( $element ) {
+                       switch ( $element ) {
                                case 'NAMESPACES':
 ?>
 <div id="p-namespaces" role="navigation" class="vectorTabs<?php if ( count( $this->data['namespace_urls'] ) == 0 ) { echo ' emptyPortlet'; } ?>">
index f587171..cfd63f5 100644 (file)
@@ -58,7 +58,7 @@ class RequestContextTest extends MediaWikiTestCase {
                $this->assertEquals( $sinfo['userId'], $context->getUser()->getId(), "Correct context user ID." );
                $this->assertEquals( 'UnitTestContextUser', $context->getUser()->getName(), "Correct context user name." );
 
-               unset ( $sc ); // restore previous context
+               unset( $sc ); // restore previous context
 
                $info = $context->exportSession();
                $this->assertEquals( $oInfo['ip'], $info['ip'], "Correct initial IP address." );