From 9f14ecf829452d3bc2f8bd3dd1a93a2841a92064 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Fri, 26 Apr 2013 16:42:31 +0200 Subject: [PATCH] Added space after switch/Removed spaces after unset While at it, added/removed some other spaces in the same files Change-Id: I84d8001aa123a008807ad5eb76f396aed7c899a4 --- includes/AjaxDispatcher.php | 2 +- includes/Article.php | 6 +- includes/Autopromote.php | 2 +- includes/Block.php | 12 ++-- includes/FormOptions.php | 2 +- includes/GlobalFunctions.php | 2 +- includes/HttpFunctions.php | 2 +- includes/Import.php | 8 +-- includes/MimeMagic.php | 6 +- includes/SkinLegacy.php | 2 +- includes/SkinTemplate.php | 2 +- includes/Title.php | 12 ++-- includes/api/ApiEditPage.php | 4 +- includes/api/ApiFormatXml.php | 2 +- includes/api/ApiPageSet.php | 4 +- includes/api/ApiQueryRecentChanges.php | 2 +- includes/api/ApiUpload.php | 2 +- includes/db/DatabaseMssql.php | 2 +- includes/db/DatabaseOracle.php | 2 +- includes/db/DatabasePostgres.php | 2 +- includes/diff/DairikiDiff.php | 2 +- includes/installer/LocalSettingsGenerator.php | 2 +- includes/logging/LogFormatter.php | 16 ++--- includes/logging/LogPage.php | 2 +- includes/media/BitmapMetadataHandler.php | 2 +- includes/media/FormatMetadata.php | 72 +++++++++---------- includes/media/IPTC.php | 2 +- includes/media/SVGMetadataExtractor.php | 4 +- includes/media/XMP.php | 4 +- includes/parser/CoreParserFunctions.php | 8 +-- includes/parser/Parser.php | 12 ++-- includes/search/SearchEngine.php | 2 +- includes/search/SearchMySQL.php | 2 +- includes/specials/SpecialUnblock.php | 4 +- includes/specials/SpecialUpload.php | 2 +- includes/specials/SpecialWatchlist.php | 4 +- languages/Language.php | 2 +- languages/classes/LanguageKk.php | 4 +- maintenance/backup.inc | 4 +- maintenance/backupPrefetch.inc | 8 +-- maintenance/backupTextPass.inc | 4 +- maintenance/getConfiguration.php | 2 +- maintenance/language/checkLanguage.inc | 6 +- maintenance/mwdocgen.php | 6 +- skins/Vector.php | 6 +- tests/phpunit/includes/RequestContextTest.php | 2 +- 46 files changed, 131 insertions(+), 131 deletions(-) diff --git a/includes/AjaxDispatcher.php b/includes/AjaxDispatcher.php index b00cf30941..e22fe20af9 100644 --- a/includes/AjaxDispatcher.php +++ b/includes/AjaxDispatcher.php @@ -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"] ) ) { diff --git a/includes/Article.php b/includes/Article.php index 1354a4864c..87b94ae975 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -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( "
\n\$1\n
", array( 'userpage-userdoesnotexist-view', wfEscapeWikiText( $rootPart ) ) ); } elseif ( $user->isBlocked() ) { # Show log extract if the user is currently blocked diff --git a/includes/Autopromote.php b/includes/Autopromote.php index 604b9248c3..ec9dcf5376 100644 --- a/includes/Autopromote.php +++ b/includes/Autopromote.php @@ -165,7 +165,7 @@ class Autopromote { return false; } - switch( $cond[0] ) { + switch ( $cond[0] ) { case APCOND_EMAILCONFIRMED: if ( Sanitizer::validateEmail( $user->getEmail() ) ) { if ( $wgEmailAuthentication ) { diff --git a/includes/Block.php b/includes/Block.php index eab1754cae..47ddc7d8f2 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -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... 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 ) { diff --git a/includes/FormOptions.php b/includes/FormOptions.php index 0a5cb68c0f..530b0946d7 100644 --- a/includes/FormOptions.php +++ b/includes/FormOptions.php @@ -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; diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index a81a33837e..320a57d01a 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -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; diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php index 28daf917a7..2da368cd68 100644 --- a/includes/HttpFunctions.php +++ b/includes/HttpFunctions.php @@ -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': diff --git a/includes/Import.php b/includes/Import.php index 8220287be7..bf5a3fb4d6 100644 --- a/includes/Import.php +++ b/includes/Import.php @@ -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. diff --git a/includes/MimeMagic.php b/includes/MimeMagic.php index 1627b3d440..44fafcaf15 100644 --- a/includes/MimeMagic.php +++ b/includes/MimeMagic.php @@ -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": diff --git a/includes/SkinLegacy.php b/includes/SkinLegacy.php index 9b9485e8e4..ae65b9dad1 100644 --- a/includes/SkinLegacy.php +++ b/includes/SkinLegacy.php @@ -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; diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 17c7808ad1..e53d424f9e 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -1827,7 +1827,7 @@ abstract class BaseTemplate extends QuickTemplate { } function makeSearchButton( $mode, $attrs = array() ) { - switch( $mode ) { + switch ( $mode ) { case 'go': case 'fulltext': $realAttrs = array( diff --git a/includes/Title.php b/includes/Title.php index b5dd6de4b2..739c52a38f 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -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 diff --git a/includes/api/ApiEditPage.php b/includes/api/ApiEditPage.php index ab60008153..e7e5e1d49a 100644 --- a/includes/api/ApiEditPage.php +++ b/includes/api/ApiEditPage.php @@ -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' ); diff --git a/includes/api/ApiFormatXml.php b/includes/api/ApiFormatXml.php index f9b85efabb..4ec149c09e 100644 --- a/includes/api/ApiFormatXml.php +++ b/includes/api/ApiFormatXml.php @@ -155,7 +155,7 @@ class ApiFormatXml extends ApiFormatBase { unset( $elemValue[$subElemId] ); } elseif ( is_array( $subElemValue ) ) { $subElements[$subElemId] = $subElemValue; - unset ( $elemValue[$subElemId] ); + unset( $elemValue[$subElemId] ); } } diff --git a/includes/api/ApiPageSet.php b/includes/api/ApiPageSet.php index 0645edbed8..3caf81f0ed 100644 --- a/includes/api/ApiPageSet.php +++ b/includes/api/ApiPageSet.php @@ -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( diff --git a/includes/api/ApiQueryRecentChanges.php b/includes/api/ApiQueryRecentChanges.php index 8aceab22bd..7cb445d8cd 100644 --- a/includes/api/ApiQueryRecentChanges.php +++ b/includes/api/ApiQueryRecentChanges.php @@ -499,7 +499,7 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase { } return $retval; } - switch( $type ) { + switch ( $type ) { case 'edit': return RC_EDIT; case 'new': diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php index a8d71154c4..5563087b25 100644 --- a/includes/api/ApiUpload.php +++ b/includes/api/ApiUpload.php @@ -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' ); diff --git a/includes/db/DatabaseMssql.php b/includes/db/DatabaseMssql.php index 427fd3dbcf..da719be00e 100644 --- a/includes/db/DatabaseMssql.php +++ b/includes/db/DatabaseMssql.php @@ -1049,7 +1049,7 @@ class MssqlResult { $arrNum[] = $value; } } - switch( $mode ) { + switch ( $mode ) { case SQLSRV_FETCH_ASSOC: $ret = $this->mRows[$this->mCursor]; break; diff --git a/includes/db/DatabaseOracle.php b/includes/db/DatabaseOracle.php index a3f6805252..3333f4a0ca 100644 --- a/includes/db/DatabaseOracle.php +++ b/includes/db/DatabaseOracle.php @@ -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; diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php index 704b70edf8..e12175f4d7 100644 --- a/includes/db/DatabasePostgres.php +++ b/includes/db/DatabasePostgres.php @@ -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': diff --git a/includes/diff/DairikiDiff.php b/includes/diff/DairikiDiff.php index e78045a88c..4435fc6d3c 100644 --- a/includes/diff/DairikiDiff.php +++ b/includes/diff/DairikiDiff.php @@ -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( diff --git a/includes/installer/LocalSettingsGenerator.php b/includes/installer/LocalSettingsGenerator.php index d3dfc833f6..cd7e53ceb7 100644 --- a/includes/installer/LocalSettingsGenerator.php +++ b/includes/installer/LocalSettingsGenerator.php @@ -222,7 +222,7 @@ class LocalSettingsGenerator { } } - switch( $this->values['wgMainCacheType'] ) { + switch ( $this->values['wgMainCacheType'] ) { case 'anything': case 'db': case 'memcached': diff --git a/includes/logging/LogFormatter.php b/includes/logging/LogFormatter.php index 27526f591f..8f60aee16e 100644 --- a/includes/logging/LogFormatter.php +++ b/includes/logging/LogFormatter.php @@ -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; diff --git a/includes/logging/LogPage.php b/includes/logging/LogPage.php index 3fe91fc1e2..9d6ab25bbd 100644 --- a/includes/logging/LogPage.php +++ b/includes/logging/LogPage.php @@ -331,7 +331,7 @@ class LogPage { return $title->getPrefixedText(); } - switch( $type ) { + switch ( $type ) { case 'move': $titleLink = Linker::link( $title, diff --git a/includes/media/BitmapMetadataHandler.php b/includes/media/BitmapMetadataHandler.php index 555a414ed0..7c39c81445 100644 --- a/includes/media/BitmapMetadataHandler.php +++ b/includes/media/BitmapMetadataHandler.php @@ -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': diff --git a/includes/media/FormatMetadata.php b/includes/media/FormatMetadata.php index 3d153eb681..276af4d780 100644 --- a/includes/media/FormatMetadata.php +++ b/includes/media/FormatMetadata.php @@ -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; diff --git a/includes/media/IPTC.php b/includes/media/IPTC.php index 6e04b3dbff..544dd21152 100644 --- a/includes/media/IPTC.php +++ b/includes/media/IPTC.php @@ -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; diff --git a/includes/media/SVGMetadataExtractor.php b/includes/media/SVGMetadataExtractor.php index c9a20f2978..948a0f8cce 100644 --- a/includes/media/SVGMetadataExtractor.php +++ b/includes/media/SVGMetadataExtractor.php @@ -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 //