From 6f79eef473a982c983377fa877cffbdf2a03be03 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sat, 27 Apr 2013 14:02:08 +0200 Subject: [PATCH] Fixed spacing around parenthesis in includes Change-Id: Ie8adc00f4ee8ecec4554e584c18d5d2073415397 --- includes/ChangesList.php | 2 +- includes/Export.php | 4 ++-- includes/GlobalFunctions.php | 2 +- includes/HistoryBlob.php | 2 +- includes/Hooks.php | 4 ++-- includes/IP.php | 2 +- includes/Init.php | 6 +++--- includes/Sanitizer.php | 2 +- includes/StringUtils.php | 2 +- includes/Timestamp.php | 4 ++-- includes/User.php | 2 +- includes/actions/WatchAction.php | 4 ++-- includes/api/ApiFeedContributions.php | 2 +- includes/api/ApiQueryAllImages.php | 2 +- includes/api/ApiQueryBase.php | 2 +- includes/api/ApiQueryCategoryMembers.php | 2 +- includes/api/ApiQuerySearch.php | 2 +- includes/cache/HTMLFileCache.php | 2 +- includes/cache/LocalisationCache.php | 2 +- includes/content/WikitextContent.php | 2 +- includes/db/Database.php | 2 +- includes/db/DatabaseMysql.php | 2 +- includes/db/DatabaseOracle.php | 2 +- includes/db/LBFactory.php | 2 +- includes/externalstore/ExternalStoreDB.php | 2 +- includes/filerepo/FileRepo.php | 2 +- includes/installer/Installer.php | 4 ++-- includes/installer/MysqlInstaller.php | 8 ++++---- includes/installer/WebInstaller.php | 2 +- includes/job/jobs/RefreshLinksJob.php | 2 +- includes/logging/LogPager.php | 4 ++-- includes/media/DjVu.php | 2 +- includes/media/GIF.php | 2 +- includes/media/PNG.php | 2 +- includes/media/SVG.php | 2 +- includes/media/SVGMetadataExtractor.php | 2 +- includes/media/XCF.php | 2 +- includes/objectcache/MemcachedClient.php | 2 +- includes/profiler/ProfilerSimpleUDP.php | 2 +- includes/resourceloader/ResourceLoader.php | 6 +++--- includes/search/SearchPostgres.php | 2 +- includes/specials/SpecialLog.php | 2 +- includes/specials/SpecialMergeHistory.php | 2 +- includes/specials/SpecialPrefixindex.php | 4 ++-- includes/specials/SpecialProtectedpages.php | 2 +- includes/specials/SpecialProtectedtitles.php | 2 +- includes/specials/SpecialRecentchanges.php | 2 +- includes/specials/SpecialUploadStash.php | 10 +++++----- includes/templates/UsercreateVForm.php | 2 +- includes/templates/UserloginVForm.php | 2 +- 50 files changed, 68 insertions(+), 68 deletions(-) diff --git a/includes/ChangesList.php b/includes/ChangesList.php index b589057026..73d3b61c49 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -1083,7 +1083,7 @@ class EnhancedChangesList extends ChangesList { } elseif ( !ChangesList::userCan( $rcObj, Revision::DELETED_TEXT, $this->getUser() ) ) { $link = '' . $rcObj->timestamp . ' '; } else { - if ( $rcObj->unpatrolled && $type == RC_NEW) { + if ( $rcObj->unpatrolled && $type == RC_NEW ) { $params['rcid'] = $rcObj->mAttribs['rc_id']; } diff --git a/includes/Export.php b/includes/Export.php index 9400c4178f..e533dbc732 100644 --- a/includes/Export.php +++ b/includes/Export.php @@ -599,7 +599,7 @@ class XmlDumpWriter { $out = " \n"; $title = Title::makeTitle( $row->page_namespace, $row->page_title ); $out .= ' ' . Xml::elementClean( 'title', array(), self::canonicalTitle( $title ) ) . "\n"; - $out .= ' ' . Xml::element( 'ns', array(), strval( $row->page_namespace) ) . "\n"; + $out .= ' ' . Xml::element( 'ns', array(), strval( $row->page_namespace ) ) . "\n"; $out .= ' ' . Xml::element( 'id', array(), strval( $row->page_id ) ) . "\n"; if ( $row->page_is_redirect ) { $page = WikiPage::factory( $title ); @@ -1191,7 +1191,7 @@ class Dump7ZipOutput extends DumpPipeOutput { // Suppress annoying useless crap from p7zip // Unfortunately this could suppress real error messages too $command .= ' >' . wfGetNull() . ' 2>&1'; - return( $command ); + return $command; } /** diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 320a57d01a..50287b32c4 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -2418,7 +2418,7 @@ function wfTimestamp( $outputtype = TS_UNIX, $ts = 0 ) { try { $timestamp = new MWTimestamp( $ts ); return $timestamp->getTimestamp( $outputtype ); - } catch( TimestampException $e ) { + } catch ( TimestampException $e ) { wfDebug( "wfTimestamp() fed bogus time value: TYPE=$outputtype; VALUE=$ts\n" ); return false; } diff --git a/includes/HistoryBlob.php b/includes/HistoryBlob.php index 8d83751efb..46cf2387fc 100644 --- a/includes/HistoryBlob.php +++ b/includes/HistoryBlob.php @@ -143,7 +143,7 @@ class ConcatenatedGzipHistoryBlob implements HistoryBlob * Compress the bulk data in the object */ public function compress() { - if ( !$this->mCompressed ) { + if ( !$this->mCompressed ) { $this->mItems = gzdeflate( serialize( $this->mItems ) ); $this->mCompressed = true; } diff --git a/includes/Hooks.php b/includes/Hooks.php index 5d8a4a7c57..ed8b3edd84 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -53,7 +53,7 @@ class Hooks { * @since 1.18 */ public static function register( $name, $callback ) { - if( !isset( self::$handlers[$name] ) ) { + if ( !isset( self::$handlers[$name] ) ) { self::$handlers[$name] = array(); } @@ -174,7 +174,7 @@ class Hooks { // Run autoloader (workaround for call_user_func_array bug) // and throw error if not callable. - if( !is_callable( $callback ) ) { + if ( !is_callable( $callback ) ) { throw new MWException( 'Invalid callback in hooks for ' . $event . "\n" ); } diff --git a/includes/IP.php b/includes/IP.php index 0a8faa2425..1e0a4f9345 100644 --- a/includes/IP.php +++ b/includes/IP.php @@ -526,7 +526,7 @@ class IP { if ( $bits == 0 ) { $network = 0; } else { - $network &= ~( ( 1 << ( 32 - $bits ) ) - 1); + $network &= ~( ( 1 << ( 32 - $bits ) ) - 1 ); } # Convert to unsigned if ( $network < 0 ) { diff --git a/includes/Init.php b/includes/Init.php index 66f9544d47..835ffdb92c 100644 --- a/includes/Init.php +++ b/includes/Init.php @@ -166,7 +166,7 @@ class MWInit { static function classExists( $class ) { try { $r = new ReflectionClass( $class ); - } catch( ReflectionException $r ) { + } catch ( ReflectionException $r ) { $r = false; } return $r !== false; @@ -187,7 +187,7 @@ class MWInit { static function methodExists( $class, $method ) { try { $r = new ReflectionMethod( $class, $method ); - } catch( ReflectionException $r ) { + } catch ( ReflectionException $r ) { $r = false; } return $r !== false; @@ -204,7 +204,7 @@ class MWInit { static function functionExists( $function ) { try { $r = new ReflectionFunction( $function ); - } catch( ReflectionException $r ) { + } catch ( ReflectionException $r ) { $r = false; } return $r !== false; diff --git a/includes/Sanitizer.php b/includes/Sanitizer.php index b9b05911d3..e757021ef8 100644 --- a/includes/Sanitizer.php +++ b/includes/Sanitizer.php @@ -606,7 +606,7 @@ class Sanitizer { */ static function removeHTMLcomments( $text ) { wfProfileIn( __METHOD__ ); - while ( ($start = strpos( $text, '', $start + 4 ); if ( $end === false ) { # Unterminated comment; bail out diff --git a/includes/StringUtils.php b/includes/StringUtils.php index 05b78e0532..48cde0eb19 100644 --- a/includes/StringUtils.php +++ b/includes/StringUtils.php @@ -65,7 +65,7 @@ class StringUtils { | [\xf8-\xfb][\x80-\xbf]{4} | \xfc[\x84-\xbf][\x80-\xbf]{4} )+$/x', $value ); - return ($hasUtf8 > 0 ); + return ( $hasUtf8 > 0 ); } } diff --git a/includes/Timestamp.php b/includes/Timestamp.php index 92e914e4b2..5296122ef1 100644 --- a/includes/Timestamp.php +++ b/includes/Timestamp.php @@ -125,7 +125,7 @@ class MWTimestamp { try { $final = new DateTime( $strtime, new DateTimeZone( 'GMT' ) ); - } catch( Exception $e ) { + } catch ( Exception $e ) { throw new TimestampException( __METHOD__ . ' Invalid timestamp format.' ); } @@ -261,7 +261,7 @@ class MWTimestamp { } } - $interval = new DateInterval('PT' . abs( $diff ) . 'M'); + $interval = new DateInterval( 'PT' . abs( $diff ) . 'M' ); if ( $diff < 1 ) { $interval->invert = 1; } diff --git a/includes/User.php b/includes/User.php index dd6407dea8..37a384cdf6 100644 --- a/includes/User.php +++ b/includes/User.php @@ -2791,7 +2791,7 @@ class User { */ public function useNPPatrol() { global $wgUseRCPatrol, $wgUseNPPatrol; - return( ( $wgUseRCPatrol || $wgUseNPPatrol ) && ( $this->isAllowedAny( 'patrol', 'patrolmarks' ) ) ); + return ( ( $wgUseRCPatrol || $wgUseNPPatrol ) && ( $this->isAllowedAny( 'patrol', 'patrolmarks' ) ) ); } /** diff --git a/includes/actions/WatchAction.php b/includes/actions/WatchAction.php index ae5f76c61a..de9e1d6975 100644 --- a/includes/actions/WatchAction.php +++ b/includes/actions/WatchAction.php @@ -87,7 +87,7 @@ class WatchAction extends FormAction { return parent::checkCanExecute( $user ); } - public static function doWatch( Title $title, User $user ) { + public static function doWatch( Title $title, User $user ) { $page = WikiPage::factory( $title ); if ( wfRunHooks( 'WatchArticle', array( &$user, &$page ) ) ) { @@ -97,7 +97,7 @@ class WatchAction extends FormAction { return true; } - public static function doUnwatch( Title $title, User $user ) { + public static function doUnwatch( Title $title, User $user ) { $page = WikiPage::factory( $title ); if ( wfRunHooks( 'UnwatchArticle', array( &$user, &$page ) ) ) { diff --git a/includes/api/ApiFeedContributions.php b/includes/api/ApiFeedContributions.php index f2a7748772..abd657cdd8 100644 --- a/includes/api/ApiFeedContributions.php +++ b/includes/api/ApiFeedContributions.php @@ -93,7 +93,7 @@ class ApiFeedContributions extends ApiBase { protected function feedItem( $row ) { $title = Title::makeTitle( intval( $row->page_namespace ), $row->page_title ); - if( $title && $title->userCan( 'read' ) ) { + if ( $title && $title->userCan( 'read' ) ) { $date = $row->rev_timestamp; $comments = $title->getTalkPage()->getFullURL(); $revision = Revision::newFromRow( $row ); diff --git a/includes/api/ApiQueryAllImages.php b/includes/api/ApiQueryAllImages.php index 566c2087f3..ccc7a3a29e 100644 --- a/includes/api/ApiQueryAllImages.php +++ b/includes/api/ApiQueryAllImages.php @@ -189,7 +189,7 @@ class ApiQueryAllImages extends ApiQueryGeneratorBase { if ( !is_null( $params['mime'] ) ) { global $wgMiserMode; - if ( $wgMiserMode ) { + if ( $wgMiserMode ) { $this->dieUsage( 'MIME search disabled in Miser Mode', 'mimesearchdisabled' ); } diff --git a/includes/api/ApiQueryBase.php b/includes/api/ApiQueryBase.php index 44fbf58c4d..8668e04ba6 100644 --- a/includes/api/ApiQueryBase.php +++ b/includes/api/ApiQueryBase.php @@ -478,7 +478,7 @@ abstract class ApiQueryBase extends ApiBase { * @param $protocol String * @return null|string */ - public function prepareUrlQuerySearchString( $query = null, $protocol = null) { + public function prepareUrlQuerySearchString( $query = null, $protocol = null ) { $db = $this->getDb(); if ( !is_null( $query ) || $query != '' ) { if ( is_null( $protocol ) ) { diff --git a/includes/api/ApiQueryCategoryMembers.php b/includes/api/ApiQueryCategoryMembers.php index 124908b4de..704d108a0c 100644 --- a/includes/api/ApiQueryCategoryMembers.php +++ b/includes/api/ApiQueryCategoryMembers.php @@ -217,7 +217,7 @@ class ApiQueryCategoryMembers extends ApiQueryGeneratorBase { if ( $fld_sortkeyprefix ) { $vals['sortkeyprefix'] = $row->cl_sortkey_prefix; } - if ( $fld_type ) { + if ( $fld_type ) { $vals['type'] = $row->cl_type; } if ( $fld_timestamp ) { diff --git a/includes/api/ApiQuerySearch.php b/includes/api/ApiQuerySearch.php index ab78ba6710..034983026f 100644 --- a/includes/api/ApiQuerySearch.php +++ b/includes/api/ApiQuerySearch.php @@ -93,7 +93,7 @@ class ApiQuerySearch extends ApiQueryGeneratorBase { } if ( is_null( $matches ) ) { $this->dieUsage( "{$what} search is disabled", "search-{$what}-disabled" ); - } elseif( $matches instanceof Status && !$matches->isGood() ) { + } elseif ( $matches instanceof Status && !$matches->isGood() ) { $this->dieUsage( $matches->getWikiText(), 'search-error' ); } diff --git a/includes/cache/HTMLFileCache.php b/includes/cache/HTMLFileCache.php index 055fd685f2..82334817a9 100644 --- a/includes/cache/HTMLFileCache.php +++ b/includes/cache/HTMLFileCache.php @@ -163,7 +163,7 @@ class HTMLFileCache extends FileCacheBase { return $text; } - wfDebug( __METHOD__ . "()\n", false); + wfDebug( __METHOD__ . "()\n", false ); $now = wfTimestampNow(); if ( $this->useGzip() ) { diff --git a/includes/cache/LocalisationCache.php b/includes/cache/LocalisationCache.php index d093b586e0..8069836b01 100644 --- a/includes/cache/LocalisationCache.php +++ b/includes/cache/LocalisationCache.php @@ -525,7 +525,7 @@ class LocalisationCache { } try { $compiledRules = CLDRPluralRuleEvaluator::compile( $rules ); - } catch( CLDRPluralRuleError $e ) { + } catch ( CLDRPluralRuleError $e ) { wfDebugLog( 'l10n', $e->getMessage() . "\n" ); return array(); } diff --git a/includes/content/WikitextContent.php b/includes/content/WikitextContent.php index 580ec75056..26337db947 100644 --- a/includes/content/WikitextContent.php +++ b/includes/content/WikitextContent.php @@ -61,7 +61,7 @@ class WikitextContent extends TextContent { $myModelId = $this->getModel(); $sectionModelId = $with->getModel(); - if ( $sectionModelId != $myModelId ) { + if ( $sectionModelId != $myModelId ) { wfProfileOut( __METHOD__ ); throw new MWException( "Incompatible content model for section: " . "document uses $myModelId but " . diff --git a/includes/db/Database.php b/includes/db/Database.php index 70fc1f3f6e..b315facaf7 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -585,7 +585,7 @@ abstract class DatabaseBase implements DatabaseType { public function setFlag( $flag ) { global $wgDebugDBTransactions; $this->mFlags |= $flag; - if ( ( $flag & DBO_TRX) & $wgDebugDBTransactions ) { + if ( ( $flag & DBO_TRX ) & $wgDebugDBTransactions ) { wfDebug( "Implicit transactions are now disabled.\n" ); } } diff --git a/includes/db/DatabaseMysql.php b/includes/db/DatabaseMysql.php index 000993715b..4105ee1ad6 100644 --- a/includes/db/DatabaseMysql.php +++ b/includes/db/DatabaseMysql.php @@ -901,7 +901,7 @@ class DatabaseMysql extends DatabaseBase { * @return array */ function listTables( $prefix = null, $fname = 'DatabaseMysql::listTables' ) { - $result = $this->query( "SHOW TABLES", $fname); + $result = $this->query( "SHOW TABLES", $fname ); $endArray = array(); diff --git a/includes/db/DatabaseOracle.php b/includes/db/DatabaseOracle.php index 3333f4a0ca..34305f763d 100644 --- a/includes/db/DatabaseOracle.php +++ b/includes/db/DatabaseOracle.php @@ -691,7 +691,7 @@ class DatabaseOracle extends DatabaseBase { function tableNameInternal( $name ) { $name = $this->tableName( $name ); - return preg_replace( '/.*\.(.*)/', '$1', $name); + return preg_replace( '/.*\.(.*)/', '$1', $name ); } /** * Return the next in a sequence, save the value for retrieval via insertId() diff --git a/includes/db/LBFactory.php b/includes/db/LBFactory.php index be82f4e467..16c43a009f 100644 --- a/includes/db/LBFactory.php +++ b/includes/db/LBFactory.php @@ -300,7 +300,7 @@ class LBFactory_Fake extends LBFactory { function __construct( $conf ) { } - function newMainLB( $wiki = false) { + function newMainLB( $wiki = false ) { throw new DBAccessError; } diff --git a/includes/externalstore/ExternalStoreDB.php b/includes/externalstore/ExternalStoreDB.php index 99192369c0..be9c066ab7 100644 --- a/includes/externalstore/ExternalStoreDB.php +++ b/includes/externalstore/ExternalStoreDB.php @@ -166,7 +166,7 @@ class ExternalStoreDB extends ExternalStoreMedium { // Try the master $dbw =& $this->getMaster( $cluster ); $ret = $dbw->selectField( $this->getTable( $dbw ), 'blob_text', array( 'blob_id' => $id ), __METHOD__ ); - if ( $ret === false) { + if ( $ret === false ) { wfDebugLog( 'ExternalStoreDB', "ExternalStoreDB::fetchBlob master failed to find $cacheID\n" ); } } diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php index cfc3af7f6f..aa41135fa1 100644 --- a/includes/filerepo/FileRepo.php +++ b/includes/filerepo/FileRepo.php @@ -383,7 +383,7 @@ class FileRepo { return false; } $redir = $this->checkRedirect( $title ); - if ( $redir && $title->getNamespace() == NS_FILE) { + if ( $redir && $title->getNamespace() == NS_FILE ) { $img = $this->newFile( $redir ); if ( !$img ) { return false; diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 44a7241054..e35719d4c0 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -1284,7 +1284,7 @@ abstract class Installer { try { $text = Http::get( $url . $file, array( 'timeout' => 3 ) ); } - catch( MWException $e ) { + catch ( MWException $e ) { // Http::get throws with allow_url_fopen = false and no curl extension. $text = null; } @@ -1561,7 +1561,7 @@ abstract class Installer { try { $user->setPassword( $this->getVar( '_AdminPassword' ) ); - } catch( PasswordError $pwe ) { + } catch ( PasswordError $pwe ) { return Status::newFatal( 'config-admin-error-password', $name, $pwe->getMessage() ); } diff --git a/includes/installer/MysqlInstaller.php b/includes/installer/MysqlInstaller.php index 84638d46be..4436173049 100644 --- a/includes/installer/MysqlInstaller.php +++ b/includes/installer/MysqlInstaller.php @@ -540,12 +540,12 @@ class MysqlInstaller extends DatabaseInstaller { foreach ( $createHostList as $host ) { $fullName = $this->buildFullUserName( $dbUser, $host ); if ( !$this->userDefinitelyExists( $dbUser, $host ) ) { - try{ + try { $this->db->begin( __METHOD__ ); $this->db->query( "CREATE USER $fullName IDENTIFIED BY $escPass", __METHOD__ ); $this->db->commit( __METHOD__ ); $grantableNames[] = $fullName; - } catch( DBQueryError $dqe ) { + } catch ( DBQueryError $dqe ) { if ( $this->db->lastErrno() == 1396 /* ER_CANNOT_USER */ ) { // User (probably) already exists $this->db->rollback( __METHOD__ ); @@ -574,7 +574,7 @@ class MysqlInstaller extends DatabaseInstaller { $this->db->begin( __METHOD__ ); $this->db->query( "GRANT ALL PRIVILEGES ON $dbAllTables TO $name", __METHOD__ ); $this->db->commit( __METHOD__ ); - } catch( DBQueryError $dqe ) { + } catch ( DBQueryError $dqe ) { $this->db->rollback( __METHOD__ ); $status->fatal( 'config-install-user-grant-failed', $dbUser, $dqe->getText() ); } @@ -605,7 +605,7 @@ class MysqlInstaller extends DatabaseInstaller { $res = $this->db->selectRow( 'mysql.user', array( 'Host', 'User' ), array( 'Host' => $host, 'User' => $user ), __METHOD__ ); return (bool)$res; - } catch( DBQueryError $dqe ) { + } catch ( DBQueryError $dqe ) { return false; } diff --git a/includes/installer/WebInstaller.php b/includes/installer/WebInstaller.php index 9c565584e9..10c7b96224 100644 --- a/includes/installer/WebInstaller.php +++ b/includes/installer/WebInstaller.php @@ -1067,7 +1067,7 @@ class WebInstaller extends Installer { * @param $parser * @return String Html for download link */ - public function downloadLinkHook( $text, $attribs, $parser ) { + public function downloadLinkHook( $text, $attribs, $parser ) { $img = Html::element( 'img', array( 'src' => '../skins/common/images/download-32.png', 'width' => '32', diff --git a/includes/job/jobs/RefreshLinksJob.php b/includes/job/jobs/RefreshLinksJob.php index 4a5ecfc3d6..57cad874ff 100644 --- a/includes/job/jobs/RefreshLinksJob.php +++ b/includes/job/jobs/RefreshLinksJob.php @@ -136,7 +136,7 @@ class RefreshLinksJob2 extends Job { // Hopefully, when leaf jobs are popped, the slaves will have reached that position. if ( isset( $this->params['masterPos'] ) ) { $masterPos = $this->params['masterPos']; - } elseif ( wfGetLB()->getServerCount() > 1 ) { + } elseif ( wfGetLB()->getServerCount() > 1 ) { $masterPos = wfGetLB()->getMasterPos(); } else { $masterPos = false; diff --git a/includes/logging/LogPager.php b/includes/logging/LogPager.php index 5ffad43a7b..963ec64224 100644 --- a/includes/logging/LogPager.php +++ b/includes/logging/LogPager.php @@ -212,9 +212,9 @@ class LogPager extends ReverseChronologicalPager { // Paranoia: avoid brute force searches (bug 17342) $user = $this->getUser(); if ( !$user->isAllowed( 'deletedhistory' ) ) { - $this->mConds[] = $db->bitAnd( 'log_deleted', LogPage::DELETED_ACTION) . ' = 0'; + $this->mConds[] = $db->bitAnd( 'log_deleted', LogPage::DELETED_ACTION ) . ' = 0'; } elseif ( !$user->isAllowed( 'suppressrevision' ) ) { - $this->mConds[] = $db->bitAnd( 'log_deleted', LogPage::SUPPRESSED_ACTION) . + $this->mConds[] = $db->bitAnd( 'log_deleted', LogPage::SUPPRESSED_ACTION ) . ' != ' . LogPage::SUPPRESSED_ACTION; } } diff --git a/includes/media/DjVu.php b/includes/media/DjVu.php index 8d4e033569..b9e89d9d22 100644 --- a/includes/media/DjVu.php +++ b/includes/media/DjVu.php @@ -257,7 +257,7 @@ class DjVuHandler extends ImageHandler { } else { $image->dejaMetaTree = $tree; } - } catch( Exception $e ) { + } catch ( Exception $e ) { wfDebug( "Bogus multipage XML metadata on '{$image->getName()}'\n" ); } wfRestoreWarnings(); diff --git a/includes/media/GIF.php b/includes/media/GIF.php index 4bb7208332..6949f94028 100644 --- a/includes/media/GIF.php +++ b/includes/media/GIF.php @@ -33,7 +33,7 @@ class GIFHandler extends BitmapHandler { function getMetadata( $image, $filename ) { try { $parsedGIFMetadata = BitmapMetadataHandler::GIF( $filename ); - } catch( Exception $e ) { + } catch ( Exception $e ) { // Broken file? wfDebug( __METHOD__ . ': ' . $e->getMessage() . "\n" ); return self::BROKEN_FILE; diff --git a/includes/media/PNG.php b/includes/media/PNG.php index 9dfd5d1a4a..0afbc6fcf5 100644 --- a/includes/media/PNG.php +++ b/includes/media/PNG.php @@ -38,7 +38,7 @@ class PNGHandler extends BitmapHandler { function getMetadata( $image, $filename ) { try { $metadata = BitmapMetadataHandler::PNG( $filename ); - } catch( Exception $e ) { + } catch ( Exception $e ) { // Broken file? wfDebug( __METHOD__ . ': ' . $e->getMessage() . "\n" ); return self::BROKEN_FILE; diff --git a/includes/media/SVG.php b/includes/media/SVG.php index 423e75631b..2987588ed9 100644 --- a/includes/media/SVG.php +++ b/includes/media/SVG.php @@ -263,7 +263,7 @@ class SvgHandler extends ImageHandler { $metadata = array( 'version' => self::SVG_METADATA_VERSION ); try { $metadata += SVGMetadataExtractor::getMetadata( $filename ); - } catch( MWException $e ) { // @TODO: SVG specific exceptions + } catch ( MWException $e ) { // @TODO: SVG specific exceptions // File not found, broken, etc. $metadata['error'] = array( 'message' => $e->getMessage(), diff --git a/includes/media/SVGMetadataExtractor.php b/includes/media/SVGMetadataExtractor.php index 948a0f8cce..2e33bb9826 100644 --- a/includes/media/SVGMetadataExtractor.php +++ b/includes/media/SVGMetadataExtractor.php @@ -101,7 +101,7 @@ class SVGReader { wfSuppressWarnings(); try { $this->read(); - } catch( Exception $e ) { + } catch ( Exception $e ) { // Note, if this happens, the width/height will be taken to be 0x0. // Should we consider it the default 512x512 instead? wfRestoreWarnings(); diff --git a/includes/media/XCF.php b/includes/media/XCF.php index 8872d7362d..e77d384229 100644 --- a/includes/media/XCF.php +++ b/includes/media/XCF.php @@ -110,7 +110,7 @@ class XCFHandler extends BitmapHandler { . "/Nbase_type" # / , $binaryHeader ); - } catch( MWException $mwe ) { + } catch ( MWException $mwe ) { return false; } diff --git a/includes/objectcache/MemcachedClient.php b/includes/objectcache/MemcachedClient.php index f4c034afba..e5f60b555c 100644 --- a/includes/objectcache/MemcachedClient.php +++ b/includes/objectcache/MemcachedClient.php @@ -1123,7 +1123,7 @@ class MWMemcached { function _fwrite( $sock, $buf ) { $bytesWritten = 0; $bufSize = strlen( $buf ); - while ( $bytesWritten < $bufSize ) { + while ( $bytesWritten < $bufSize ) { $result = fwrite( $sock, $buf ); $data = stream_get_meta_data( $sock ); if ( $data['timed_out'] ) { diff --git a/includes/profiler/ProfilerSimpleUDP.php b/includes/profiler/ProfilerSimpleUDP.php index 83bdf71eb9..2b9a322fb6 100644 --- a/includes/profiler/ProfilerSimpleUDP.php +++ b/includes/profiler/ProfilerSimpleUDP.php @@ -46,7 +46,7 @@ class ProfilerSimpleUDP extends ProfilerSimple { return; } - $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); + $sock = socket_create( AF_INET, SOCK_DGRAM, SOL_UDP ); $plength = 0; $packet = ""; foreach ( $this->mCollated as $entry => $pfdata ) { diff --git a/includes/resourceloader/ResourceLoader.php b/includes/resourceloader/ResourceLoader.php index dd613a74d7..aa018fca25 100644 --- a/includes/resourceloader/ResourceLoader.php +++ b/includes/resourceloader/ResourceLoader.php @@ -318,7 +318,7 @@ class ResourceLoader { * @param array $properties source properties * @throws MWException */ - public function addSource( $id, $properties = null) { + public function addSource( $id, $properties = null ) { // Allow multiple sources to be registered in one call if ( is_array( $id ) ) { foreach ( $id as $key => $value ) { @@ -466,7 +466,7 @@ class ResourceLoader { // Preload information needed to the mtime calculation below try { $this->preloadModuleInfo( array_keys( $modules ), $context ); - } catch( Exception $e ) { + } catch ( Exception $e ) { // Add exception to the output as a comment $errors .= $this->makeComment( $e->__toString() ); $this->hasErrors = true; @@ -637,7 +637,7 @@ class ResourceLoader { if ( !$good ) { try { // RL always hits the DB on file cache miss... wfGetDB( DB_SLAVE ); - } catch( DBConnectionError $e ) { // ...check if we need to fallback to cache + } catch ( DBConnectionError $e ) { // ...check if we need to fallback to cache $good = $fileCache->isCacheGood(); // cache existence check } } diff --git a/includes/search/SearchPostgres.php b/includes/search/SearchPostgres.php index 2fe31c9ec9..7f19ed13ff 100644 --- a/includes/search/SearchPostgres.php +++ b/includes/search/SearchPostgres.php @@ -64,7 +64,7 @@ class SearchPostgres extends SearchEngine { function searchText( $term ) { $q = $this->searchQuery( $term, 'textvector', 'old_text' ); - $olderror = error_reporting(E_ERROR); + $olderror = error_reporting( E_ERROR ); $resultSet = $this->db->resultObject( $this->db->query( $q, 'SearchPostgres', true ) ); error_reporting( $olderror ); if ( !$resultSet ) { diff --git a/includes/specials/SpecialLog.php b/includes/specials/SpecialLog.php index 5b6ff18a4d..cf690f6f3a 100644 --- a/includes/specials/SpecialLog.php +++ b/includes/specials/SpecialLog.php @@ -117,7 +117,7 @@ class SpecialLog extends SpecialPage { global $wgLogTypes; # Get parameters - $parms = explode( '/', ($par = ( $par !== null ) ? $par : '' ) ); + $parms = explode( '/', ( $par = ( $par !== null ) ? $par : '' ) ); $symsForAll = array( '*', 'all' ); if ( $parms[0] != '' && ( in_array( $par, $wgLogTypes ) || in_array( $par, $symsForAll ) ) ) { $opts->setValue( 'type', $par ); diff --git a/includes/specials/SpecialMergeHistory.php b/includes/specials/SpecialMergeHistory.php index 013c800cda..2e7f672b5a 100644 --- a/includes/specials/SpecialMergeHistory.php +++ b/includes/specials/SpecialMergeHistory.php @@ -354,7 +354,7 @@ class SpecialMergeHistory extends SpecialPage { $haveRevisions = $dbw->selectField( 'revision', 'rev_timestamp', - array( 'rev_page' => $this->mTargetID ), + array( 'rev_page' => $this->mTargetID ), __METHOD__, array( 'FOR UPDATE' ) ); diff --git a/includes/specials/SpecialPrefixindex.php b/includes/specials/SpecialPrefixindex.php index 35b5e3cd6d..065c141c62 100644 --- a/includes/specials/SpecialPrefixindex.php +++ b/includes/specials/SpecialPrefixindex.php @@ -193,13 +193,13 @@ class SpecialPrefixindex extends SpecialAllpages { while ( ( $n < $this->maxPerPage ) && ( $s = $res->fetchObject() ) ) { $t = Title::makeTitle( $s->page_namespace, $s->page_title ); if ( $t ) { - $link = ($s->page_is_redirect ? '
' : '' ) . + $link = ( $s->page_is_redirect ? '
' : '' ) . Linker::linkKnown( $t, htmlspecialchars( $t->getText() ), $s->page_is_redirect ? array( 'class' => 'mw-redirect' ) : array() ) . - ($s->page_is_redirect ? '
' : '' ); + ( $s->page_is_redirect ? '
' : '' ); } else { $link = '[[' . htmlspecialchars( $s->page_title ) . ']]'; } diff --git a/includes/specials/SpecialProtectedpages.php b/includes/specials/SpecialProtectedpages.php index 3fdaf6b7b8..4c5d1aa56f 100644 --- a/includes/specials/SpecialProtectedpages.php +++ b/includes/specials/SpecialProtectedpages.php @@ -255,7 +255,7 @@ class SpecialProtectedpages extends SpecialPage { // Third pass generates sorted XHTML content foreach ( $m as $text => $type ) { - $selected = ($type == $pr_type ); + $selected = ( $type == $pr_type ); $options[] = Xml::option( $text, $type, $selected ) . "\n"; } diff --git a/includes/specials/SpecialProtectedtitles.php b/includes/specials/SpecialProtectedtitles.php index 7b916cf519..7055f2f768 100644 --- a/includes/specials/SpecialProtectedtitles.php +++ b/includes/specials/SpecialProtectedtitles.php @@ -181,7 +181,7 @@ class SpecialProtectedtitles extends SpecialPage { } // Third pass generates sorted XHTML content foreach ( $m as $text => $type ) { - $selected = ($type == $pr_level ); + $selected = ( $type == $pr_level ); $options[] = Xml::option( $text, $type, $selected ); } diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index c37f21605c..09170699a7 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -47,7 +47,7 @@ class SpecialRecentChanges extends IncludableSpecialPage { $opts->add( 'from', '' ); $opts->add( 'hideminor', $this->getUser()->getBoolOption( 'hideminor' ) ); - $opts->add( 'hidebots', true ); + $opts->add( 'hidebots', true ); $opts->add( 'hideanons', false ); $opts->add( 'hideliu', false ); $opts->add( 'hidepatrolled', $this->getUser()->getBoolOption( 'hidepatrolled' ) ); diff --git a/includes/specials/SpecialUploadStash.php b/includes/specials/SpecialUploadStash.php index 238d838bd7..e7f36ee57f 100644 --- a/includes/specials/SpecialUploadStash.php +++ b/includes/specials/SpecialUploadStash.php @@ -88,19 +88,19 @@ class SpecialUploadStash extends UnlistedSpecialPage { } else { return $this->outputLocalFile( $params['file'] ); } - } catch( UploadStashFileNotFoundException $e ) { + } catch ( UploadStashFileNotFoundException $e ) { $code = 404; $message = $e->getMessage(); - } catch( UploadStashZeroLengthFileException $e ) { + } catch ( UploadStashZeroLengthFileException $e ) { $code = 500; $message = $e->getMessage(); - } catch( UploadStashBadPathException $e ) { + } catch ( UploadStashBadPathException $e ) { $code = 500; $message = $e->getMessage(); - } catch( SpecialUploadStashTooLargeException $e ) { + } catch ( SpecialUploadStashTooLargeException $e ) { $code = 500; $message = 'Cannot serve a file larger than ' . self::MAX_SERVE_BYTES . ' bytes. ' . $e->getMessage(); - } catch( Exception $e ) { + } catch ( Exception $e ) { $code = 500; $message = $e->getMessage(); } diff --git a/includes/templates/UsercreateVForm.php b/includes/templates/UsercreateVForm.php index 0366aefc39..f379e3a266 100644 --- a/includes/templates/UsercreateVForm.php +++ b/includes/templates/UsercreateVForm.php @@ -204,7 +204,7 @@ class UsercreateTemplateVForm extends BaseTemplate { id="" type="checkbox" value="1" tabindex="" - > diff --git a/includes/templates/UserloginVForm.php b/includes/templates/UserloginVForm.php index 0948a2033b..0e688a49f2 100644 --- a/includes/templates/UserloginVForm.php +++ b/includes/templates/UserloginVForm.php @@ -52,7 +52,7 @@ class UserloginTemplateVForm extends BaseTemplate { data['messagetype'] == 'error' ) { ?> - msg( 'loginerror' )?>
+ msg( 'loginerror' ) ?>
html( 'message' ); -- 2.20.1