Umherirrender has uploaded a new change for review.
https://gerrit.wikimedia.org/r/176292
Change subject: Fixed spacing
......................................................................
Fixed spacing
- Added/removed spaces around parenthesis
- Added newline in empty blocks
- Added space after switch/foreach/function
- Use tabs at begin of line
- Add newline at end of file
Change-Id: I244cdb2c333489e1020931bf4ac5266a87439f0d
---
M includes/CdbCompat.php
M includes/Status.php
M includes/api/ApiOpenSearch.php
M includes/cache/LocalisationCache.php
M includes/db/Database.php
M includes/filebackend/FSFileBackend.php
M includes/media/Bitmap.php
M includes/parser/Parser.php
M includes/profiler/ProfilerStandard.php
M includes/profiler/ProfilerXhprof.php
M includes/profiler/SectionProfiler.php
M includes/profiler/output/ProfilerOutputText.php
M includes/utils/AutoloadGenerator.php
M maintenance/backupTextPass.inc
M tests/phpunit/includes/media/FormatMetadataTest.php
M tests/phpunit/maintenance/backupTextPassTest.php
16 files changed, 36 insertions(+), 32 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/92/176292/1
diff --git a/includes/CdbCompat.php b/includes/CdbCompat.php
index 0c00b39..0074cc9 100644
--- a/includes/CdbCompat.php
+++ b/includes/CdbCompat.php
@@ -29,14 +29,17 @@
/**
* @deprecated since 1.25
*/
-abstract class CdbReader extends \Cdb\Reader {}
+abstract class CdbReader extends \Cdb\Reader {
+}
/**
* @deprecated since 1.25
*/
-abstract class CdbWriter extends \Cdb\Writer {}
+abstract class CdbWriter extends \Cdb\Writer {
+}
/**
* @deprecated since 1.25
*/
-class CdbException extends \Cdb\Exception {}
+class CdbException extends \Cdb\Exception {
+}
diff --git a/includes/Status.php b/includes/Status.php
index 265eae1..fb267bd 100644
--- a/includes/Status.php
+++ b/includes/Status.php
@@ -469,7 +469,7 @@
public function __toString() {
$status = $this->isOK() ? "OK" : "Error";
if ( count( $this->errors ) ) {
- $errorcount = "collected " . ( count($this->errors) ) .
" error(s) on the way";
+ $errorcount = "collected " . ( count( $this->errors ) )
. " error(s) on the way";
} else {
$errorcount = "no errors detected";
}
@@ -486,16 +486,16 @@
$errorcount,
$valstr
);
- if ( count ($this->errors ) > 0 ) {
+ if ( count( $this->errors ) > 0 ) {
$hdr = sprintf( "+-%'-4s-+-%'-25s-+-%'-40s-+\n", "",
"", "" );
$i = 1;
$out .= "\n";
$out .= $hdr;
- foreach( $this->getStatusArray() as $stat ) {
+ foreach ( $this->getStatusArray() as $stat ) {
$out .= sprintf( "| %4d | %-25.25s | %-40.40s
|\n",
$i,
$stat[0],
- implode(" ", array_slice( $stat, 1 ) )
+ implode( " ", array_slice( $stat, 1 ) )
);
$i += 1;
}
diff --git a/includes/api/ApiOpenSearch.php b/includes/api/ApiOpenSearch.php
index 4a9e216..2235ba9 100644
--- a/includes/api/ApiOpenSearch.php
+++ b/includes/api/ApiOpenSearch.php
@@ -59,7 +59,7 @@
}
public function getCustomPrinter() {
- switch( $this->getFormat() ) {
+ switch ( $this->getFormat() ) {
case 'json':
return $this->getMain()->createPrinterByName(
'json' . $this->fm );
diff --git a/includes/cache/LocalisationCache.php
b/includes/cache/LocalisationCache.php
index 2a3cd38..4dbe26e 100644
--- a/includes/cache/LocalisationCache.php
+++ b/includes/cache/LocalisationCache.php
@@ -23,6 +23,7 @@
use Cdb\Exception as CdbException;
use Cdb\Reader as CdbReader;
use Cdb\Writer as CdbWriter;
+
/**
* Class for caching the contents of localisation files, Messages*.php
* and *.i18n.php.
diff --git a/includes/db/Database.php b/includes/db/Database.php
index fc13eeb..cbfad07 100644
--- a/includes/db/Database.php
+++ b/includes/db/Database.php
@@ -1003,7 +1003,7 @@
if ( $queryProf != '' ) {
$queryStartTime = microtime( true );
$queryProfile = new ScopedCallback(
- function() use ( $queryStartTime, $queryProf,
$isMaster ) {
+ function () use ( $queryStartTime, $queryProf,
$isMaster ) {
$trxProfiler =
Profiler::instance()->getTransactionProfiler();
$trxProfiler->recordQueryCompletion(
$queryProf, $queryStartTime, $isMaster );
}
diff --git a/includes/filebackend/FSFileBackend.php
b/includes/filebackend/FSFileBackend.php
index 9aa4ca8..c00fb81 100644
--- a/includes/filebackend/FSFileBackend.php
+++ b/includes/filebackend/FSFileBackend.php
@@ -454,10 +454,10 @@
wfDebugLog( 'FSFileBackend', __METHOD__ . ": cannot
create directory $dir" );
$status->fatal( 'directorycreateerror', $params['dir']
); // fails on races
} elseif ( !is_writable( $dir ) ) {
- wfDebugLog( 'FSFileBackend', __METHOD__ . ": directory
$dir is read-only" );
+ wfDebugLog( 'FSFileBackend', __METHOD__ . ": directory
$dir is read-only" );
$status->fatal( 'directoryreadonlyerror',
$params['dir'] );
} elseif ( !is_readable( $dir ) ) {
- wfDebugLog( 'FSFileBackend', __METHOD__ . ": directory
$dir is not readable" );
+ wfDebugLog( 'FSFileBackend', __METHOD__ . ": directory
$dir is not readable" );
$status->fatal( 'directorynotreadableerror',
$params['dir'] );
}
$this->untrapWarnings();
diff --git a/includes/media/Bitmap.php b/includes/media/Bitmap.php
index 0292af8..3c23ab9 100644
--- a/includes/media/Bitmap.php
+++ b/includes/media/Bitmap.php
@@ -344,7 +344,7 @@
$src_image = call_user_func( $loader, $params['srcPath'] );
- $rotation = function_exists( 'imagerotate' ) && !isset(
$params['disableRotation'] ) ? $this->getRotation( $image ) : 0;
+ $rotation = function_exists( 'imagerotate' ) && !isset(
$params['disableRotation'] ) ? $this->getRotation( $image ) : 0;
list( $width, $height ) = $this->extractPreRotationDimensions(
$params, $rotation );
$dst_image = imagecreatetruecolor( $width, $height );
diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php
index 1b926c4..7ea57be 100644
--- a/includes/parser/Parser.php
+++ b/includes/parser/Parser.php
@@ -532,14 +532,14 @@
// Add on template profiling data
$dataByFunc = $this->mProfiler->getFunctionStats();
- uasort( $dataByFunc, function( $a, $b ) {
+ uasort( $dataByFunc, function ( $a, $b ) {
return $a['real'] < $b['real']; // descending
order
} );
$profileReport = "Transclusion expansion time report
(%,ms,calls,template)\n";
foreach ( array_slice( $dataByFunc, 0, 10 ) as $item ) {
$profileReport .= sprintf( "%6.2f%% %8.3f %6d -
%s\n",
$item['%real'], $item['real'],
$item['calls'],
- htmlspecialchars($item['name'] ) );
+ htmlspecialchars( $item['name'] ) );
}
$text .= "\n<!-- \n$profileReport-->\n";
diff --git a/includes/profiler/ProfilerStandard.php
b/includes/profiler/ProfilerStandard.php
index ab5e3ab..8b8a25d 100644
--- a/includes/profiler/ProfilerStandard.php
+++ b/includes/profiler/ProfilerStandard.php
@@ -231,7 +231,7 @@
$this->profileIn( $section );
$that = $this;
- return new ScopedCallback( function() use ( $that, $section ) {
+ return new ScopedCallback( function () use ( $that, $section ) {
$that->profileOut( $section );
} );
}
diff --git a/includes/profiler/ProfilerXhprof.php
b/includes/profiler/ProfilerXhprof.php
index 00209e2..5fda1ad 100644
--- a/includes/profiler/ProfilerXhprof.php
+++ b/includes/profiler/ProfilerXhprof.php
@@ -130,7 +130,7 @@
if ( $exists ) {
xhprof_frame_begin( $section );
- return new ScopedCallback( function() use ( $section ) {
+ return new ScopedCallback( function () use ( $section )
{
xhprof_frame_end( $section );
} );
}
diff --git a/includes/profiler/SectionProfiler.php
b/includes/profiler/SectionProfiler.php
index 89eebbe..5591c99 100644
--- a/includes/profiler/SectionProfiler.php
+++ b/includes/profiler/SectionProfiler.php
@@ -59,7 +59,7 @@
$this->profileInInternal( $section );
$that = $this;
- return new ScopedCallback( function() use ( $that, $section ) {
+ return new ScopedCallback( function () use ( $that, $section ) {
$that->profileOutInternal( $section );
} );
}
diff --git a/includes/profiler/output/ProfilerOutputText.php
b/includes/profiler/output/ProfilerOutputText.php
index b24bbef..d37d74f 100644
--- a/includes/profiler/output/ProfilerOutputText.php
+++ b/includes/profiler/output/ProfilerOutputText.php
@@ -43,11 +43,11 @@
// Filter out really tiny entries
$min = $this->thresholdMs;
- $stats = array_filter( $stats, function( $a ) use (
$min ) {
+ $stats = array_filter( $stats, function ( $a ) use (
$min ) {
return $a['real'] > $min;
} );
// Sort descending by time elapsed
- usort( $stats, function( $a, $b ) {
+ usort( $stats, function ( $a, $b ) {
return $a['real'] < $b['real'];
} );
diff --git a/includes/utils/AutoloadGenerator.php
b/includes/utils/AutoloadGenerator.php
index 727f485..4e65e11 100644
--- a/includes/utils/AutoloadGenerator.php
+++ b/includes/utils/AutoloadGenerator.php
@@ -227,7 +227,7 @@
if ( is_string( $token ) ) {
return;
}
- switch( $token[0] ) {
+ switch ( $token[0] ) {
case T_NAMESPACE:
case T_CLASS:
case T_INTERFACE:
@@ -241,7 +241,7 @@
* @param array
*/
protected function tryEndExpect( $token ) {
- switch( $this->startToken[0] ) {
+ switch ( $this->startToken[0] ) {
case T_NAMESPACE:
if ( $token === ';' || $token === '{' ) {
$this->namespace = $this->implodeTokens() .
'\\';
diff --git a/maintenance/backupTextPass.inc b/maintenance/backupTextPass.inc
index f13cb44..85ebd51 100644
--- a/maintenance/backupTextPass.inc
+++ b/maintenance/backupTextPass.inc
@@ -895,10 +895,10 @@
$this->thisPage .= $data;
}
}
- elseif ( $this->lastName == "model" ) {
+ elseif ( $this->lastName == "model" ) {
$this->thisRevModel .= $data;
}
- elseif ( $this->lastName == "format" ) {
+ elseif ( $this->lastName == "format" ) {
$this->thisRevFormat .= $data;
}
diff --git a/tests/phpunit/includes/media/FormatMetadataTest.php
b/tests/phpunit/includes/media/FormatMetadataTest.php
index 97aa0a3..54758f9 100644
--- a/tests/phpunit/includes/media/FormatMetadataTest.php
+++ b/tests/phpunit/includes/media/FormatMetadataTest.php
@@ -90,14 +90,14 @@
'multiValue' => array( array( 'first', 'second',
'third', '_type' => 'ol' ), 'first' ),
'noType' => array( array( 'first', 'second', 'third' ),
'first' ),
'typeFirst' => array( array( '_type' => 'ol', 'first',
'second', 'third' ), 'first' ),
- 'multilang' => array(
- array( 'en' => 'first', 'de' => 'Erste', '_type' =>
'lang' ),
- array( 'en' => 'first', 'de' => 'Erste', '_type' =>
'lang' ),
- ),
- 'multilang-multivalue' => array(
- array( 'en' => array( 'first', 'second' ), 'de' =>
array( 'Erste', 'Zweite' ), '_type' => 'lang' ),
- array( 'en' => 'first', 'de' => 'Erste', '_type' =>
'lang' ),
- ),
+ 'multilang' => array(
+ array( 'en' => 'first', 'de' => 'Erste',
'_type' => 'lang' ),
+ array( 'en' => 'first', 'de' => 'Erste',
'_type' => 'lang' ),
+ ),
+ 'multilang-multivalue' => array(
+ array( 'en' => array( 'first', 'second' ), 'de'
=> array( 'Erste', 'Zweite' ), '_type' => 'lang' ),
+ array( 'en' => 'first', 'de' => 'Erste',
'_type' => 'lang' ),
+ ),
);
}
}
diff --git a/tests/phpunit/maintenance/backupTextPassTest.php
b/tests/phpunit/maintenance/backupTextPassTest.php
index 26662d5..6ef2e23 100644
--- a/tests/phpunit/maintenance/backupTextPassTest.php
+++ b/tests/phpunit/maintenance/backupTextPassTest.php
@@ -608,4 +608,4 @@
return strtoupper( $text );
}
-}
\ No newline at end of file
+}
--
To view, visit https://gerrit.wikimedia.org/r/176292
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I244cdb2c333489e1020931bf4ac5266a87439f0d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits