From c6894adefc1aedab584091500f93eff9eab94c88 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Thu, 9 May 2013 19:48:10 +0200 Subject: [PATCH] Fixed spacing Added spaces around some parenthesis Change-Id: If1e50e2a7b0046e91c0bbce8bf6641d8b2446a1d --- includes/WebStart.php | 2 +- includes/parser/CoreParserFunctions.php | 2 +- includes/specials/SpecialActiveusers.php | 8 ++++---- includes/specials/SpecialRedirect.php | 4 ++-- includes/upload/UploadBase.php | 2 +- maintenance/copyFileBackend.php | 2 +- maintenance/rebuildLocalisationCache.php | 4 ++-- profileinfo.php | 3 ++- tests/phpunit/includes/db/TestORMRowTest.php | 2 +- 9 files changed, 15 insertions(+), 14 deletions(-) diff --git a/includes/WebStart.php b/includes/WebStart.php index 81e7c13e24..ead6d77ae6 100644 --- a/includes/WebStart.php +++ b/includes/WebStart.php @@ -146,7 +146,7 @@ wfProfileIn( 'WebStart.php-ob_start' ); # that would cause us to potentially mix gzip and non-gzip output, creating a # big mess. if ( !defined( 'MW_NO_OUTPUT_BUFFER' ) && ob_get_level() == 0 ) { - require_once "$IP/includes/OutputHandler.php" ; + require_once "$IP/includes/OutputHandler.php"; ob_start( 'wfOutputHandler' ); } wfProfileOut( 'WebStart.php-ob_start' ); diff --git a/includes/parser/CoreParserFunctions.php b/includes/parser/CoreParserFunctions.php index 493611a244..be945f7aee 100644 --- a/includes/parser/CoreParserFunctions.php +++ b/includes/parser/CoreParserFunctions.php @@ -701,7 +701,7 @@ class CoreParserFunctions { # We are on current page (and not in PST), so # take length of input to parser. $length = $parser->mInputSize; - } elseif( isset( $cache[$page] ) ) { + } elseif ( isset( $cache[$page] ) ) { $length = $cache[$page]; } elseif ( $parser->incrementExpensiveFunctionCount() ) { $rev = Revision::newFromTitle( $title, false, Revision::READ_NORMAL ); diff --git a/includes/specials/SpecialActiveusers.php b/includes/specials/SpecialActiveusers.php index a2978e3bcc..63131c1b0d 100644 --- a/includes/specials/SpecialActiveusers.php +++ b/includes/specials/SpecialActiveusers.php @@ -62,7 +62,7 @@ class ActiveUsersPager extends UsersPager { $this->requestedUser = ''; if ( $un != '' ) { $username = Title::makeTitleSafe( NS_USER, $un ); - if( !is_null( $username ) ) { + if ( !is_null( $username ) ) { $this->requestedUser = $username->getText(); } } @@ -96,7 +96,7 @@ class ActiveUsersPager extends UsersPager { $conds = array( 'rc_user > 0' ); // Users - no anons $conds[] = 'rc_log_type IS NULL OR rc_log_type != ' . $dbr->addQuotes( 'newusers' ); $conds[] = 'rc_timestamp >= ' . $dbr->addQuotes( - $dbr->timestamp( wfTimestamp( TS_UNIX ) - $this->RCMaxAge*24*3600 ) ); + $dbr->timestamp( wfTimestamp( TS_UNIX ) - $this->RCMaxAge * 24 * 3600 ) ); if ( $this->requestedUser != '' ) { $conds[] = 'rc_user_text >= ' . $dbr->addQuotes( $this->requestedUser ); @@ -163,7 +163,7 @@ class ActiveUsersPager extends UsersPager { $user = User::newFromId( $row->user_id ); // User right filter - foreach( $this->hideRights as $right ) { + foreach ( $this->hideRights as $right ) { // Calling User::getRights() within the loop so that // if the hideRights() filter is empty, we don't have to // trigger the lazy-init of the big userrights array in the @@ -177,7 +177,7 @@ class ActiveUsersPager extends UsersPager { // Note: This is a different loop than for user rights, // because we're reusing it to build the group links // at the same time - foreach( $user->getGroups() as $group ) { + foreach ( $user->getGroups() as $group ) { if ( in_array( $group, $this->hideGroups ) ) { return ''; } diff --git a/includes/specials/SpecialRedirect.php b/includes/specials/SpecialRedirect.php index 210cee6f51..2681207f6b 100644 --- a/includes/specials/SpecialRedirect.php +++ b/includes/specials/SpecialRedirect.php @@ -145,7 +145,7 @@ class SpecialRedirect extends FormSpecialPage { */ function dispatch() { // the various namespaces supported by Special:Redirect - switch( $this->mType ) { + switch ( $this->mType ) { case 'user': $url = $this->dispatchUser(); break; @@ -187,7 +187,7 @@ class SpecialRedirect extends FormSpecialPage { 'options' => array(), 'default' => current( array_keys( $ns ) ), ); - foreach( $ns as $n => $m ) { + foreach ( $ns as $n => $m ) { $m = $this->msg( $m )->text(); $a['type']['options'][$m] = $n; } diff --git a/includes/upload/UploadBase.php b/includes/upload/UploadBase.php index 774650b159..fa62a99d4a 100644 --- a/includes/upload/UploadBase.php +++ b/includes/upload/UploadBase.php @@ -1087,7 +1087,7 @@ abstract class UploadBase { // bytes. There shouldn't be a legitimate reason for this to happen. wfDebug( __METHOD__ . ": Unmatched XML declaration start\n" ); return true; - } elseif ( substr( $contents, 0, 4) == "\x4C\x6F\xA7\x94" ) { + } elseif ( substr( $contents, 0, 4 ) == "\x4C\x6F\xA7\x94" ) { // EBCDIC encoded XML wfDebug( __METHOD__ . ": EBCDIC Encoded XML\n" ); return true; diff --git a/maintenance/copyFileBackend.php b/maintenance/copyFileBackend.php index 6ffd72bc06..6846edf701 100644 --- a/maintenance/copyFileBackend.php +++ b/maintenance/copyFileBackend.php @@ -118,7 +118,7 @@ class CopyFileBackend extends Maintenance { $this->statCache = array(); // clear foreach ( $dstPathsRel as $dstPathRel ) { $path = $dst->getRootStoragePath() . "/$backendRel/$dstPathRel"; - $this->statCache[sha1($path)] = $dst->getFileStat( array( 'src' => $path ) ); + $this->statCache[sha1( $path )] = $dst->getFileStat( array( 'src' => $path ) ); } $this->output( "done [" . count( $this->statCache ) . " file(s)]\n" ); } diff --git a/maintenance/rebuildLocalisationCache.php b/maintenance/rebuildLocalisationCache.php index d3114c1649..8053250e13 100644 --- a/maintenance/rebuildLocalisationCache.php +++ b/maintenance/rebuildLocalisationCache.php @@ -93,12 +93,12 @@ class RebuildLocalisationCache extends Maintenance { $lc = new LocalisationCache_BulkLoad( $conf ); $allCodes = array_keys( Language::fetchLanguageNames( null, 'mwfile' ) ); - if( $this->hasOption( 'lang' ) ) { + if ( $this->hasOption( 'lang' ) ) { # Validate requested languages $codes = array_intersect( $allCodes, explode( ',', $this->getOption( 'lang' ) ) ); # Bailed out if nothing is left - if( count( $codes ) == 0 ) { + if ( count( $codes ) == 0 ) { $this->error( 'None of the languages specified exists.', 1 ); } } else { diff --git a/profileinfo.php b/profileinfo.php index 489ff786c5..f18dfbff8e 100644 --- a/profileinfo.php +++ b/profileinfo.php @@ -386,8 +386,9 @@ if ( isset( $_REQUEST['filter'] ) ) { } $s = new profile_point( 'SQL Queries', 0, $sqltotal, 0, 0 ); - foreach ( $queries as $q ) + foreach ( $queries as $q ) { $s->add_child( $q ); + } $points[] = $s; usort( $points, 'compare_point' ); diff --git a/tests/phpunit/includes/db/TestORMRowTest.php b/tests/phpunit/includes/db/TestORMRowTest.php index 4a1b7ea582..f65642b800 100644 --- a/tests/phpunit/includes/db/TestORMRowTest.php +++ b/tests/phpunit/includes/db/TestORMRowTest.php @@ -113,7 +113,7 @@ class TestORMRowTest extends ORMRowTest { array( array( 'name' => 'Foobar', - 'time' => $dbw->timestamp('20120101020202'), + 'time' => $dbw->timestamp( '20120101020202' ), 'age' => 42, 'height' => 9000.1, 'awesome' => true, -- 2.20.1