Fix braces code style

Bug: T102805
Change-Id: I7ce4c71dd605f9be79a630602391271bb269b962
This commit is contained in:
Vivek Ghaisas 2015-06-17 16:28:51 +03:00
parent 5132a68683
commit fd9178e4c3
10 changed files with 40 additions and 17 deletions

View file

@ -617,12 +617,14 @@ class MimeMagic {
/**
* Guess the MIME type from the file contents.
*
* @todo Remove $ext param
*
* @param string $file
* @param mixed $ext
* @return bool|string
* @throws MWException
*/
private function doGuessMimeType( $file, $ext ) { // TODO: remove $ext param
private function doGuessMimeType( $file, $ext ) {
// Read a chunk of the file
MediaWiki\suppressWarnings();
$f = fopen( $file, 'rb' );

View file

@ -1089,7 +1089,9 @@ class DatabaseMssql extends DatabaseBase {
* @param string $s
* @return string
*/
public function strencode( $s ) { # Should not be called by us
public function strencode( $s ) {
// Should not be called by us
return str_replace( "'", "''", $s );
}

View file

@ -1510,7 +1510,9 @@ SQL;
return pg_unescape_bytea( $b );
}
function strencode( $s ) { # Should not be called by us
function strencode( $s ) {
// Should not be called by us
return pg_escape_string( $this->mConn, $s );
}
@ -1702,4 +1704,5 @@ SQL;
}
} // end DatabasePostgres class
class PostgresBlob extends Blob {}
class PostgresBlob extends Blob {
}

View file

@ -26,7 +26,8 @@ abstract class EventRelayer {
/**
* @param array $params
*/
public function __construct( array $params ) {}
public function __construct( array $params ) {
}
/**
* @param string $channel

View file

@ -23,4 +23,5 @@
*
* @ingroup Exception
*/
class MediaTransformInvalidParametersException extends MWException {}
class MediaTransformInvalidParametersException extends MWException {
}

View file

@ -333,7 +333,9 @@ class Article implements Page {
* @return string|bool String containing article contents, or false if null
* @deprecated since 1.21, use WikiPage::getContent() instead
*/
function fetchContent() { #BC cruft!
function fetchContent() {
// BC cruft!
ContentHandler::deprecated( __METHOD__, '1.21' );
if ( $this->mContentLoaded && $this->mContent ) {

View file

@ -39,5 +39,6 @@ class ProfileSection {
*
* @param string $name Name of the function to profile
*/
public function __construct( $name ) {}
public function __construct( $name ) {
}
}

View file

@ -145,8 +145,11 @@ abstract class Profiler {
}
// Kept BC for now, remove when possible
public function profileIn( $functionname ) {}
public function profileOut( $functionname ) {}
public function profileIn( $functionname ) {
}
public function profileOut( $functionname ) {
}
/**
* Mark the start of a custom profiling frame (e.g. DB queries).

View file

@ -26,7 +26,9 @@ class ObjectFactoryTest extends PHPUnit_Framework_TestCase {
public function testClosureExpansionDisabled() {
$obj = ObjectFactory::getObjectFromSpec( array(
'class' => 'ObjectFactoryTest_Fixture',
'args' => array( function (){ return 'unwrapped'; }, ),
'args' => array( function() {
return 'unwrapped';
}, ),
'closure_expansion' => false,
) );
$this->assertInstanceOf( 'Closure', $obj->args[0] );
@ -39,7 +41,9 @@ class ObjectFactoryTest extends PHPUnit_Framework_TestCase {
public function testClosureExpansionEnabled() {
$obj = ObjectFactory::getObjectFromSpec( array(
'class' => 'ObjectFactoryTest_Fixture',
'args' => array( function (){ return 'unwrapped'; }, ),
'args' => array( function() {
return 'unwrapped';
}, ),
'closure_expansion' => true,
) );
$this->assertInternalType( 'string', $obj->args[0] );
@ -47,7 +51,9 @@ class ObjectFactoryTest extends PHPUnit_Framework_TestCase {
$obj = ObjectFactory::getObjectFromSpec( array(
'class' => 'ObjectFactoryTest_Fixture',
'args' => array( function (){ return 'unwrapped'; }, ),
'args' => array( function() {
return 'unwrapped';
}, ),
) );
$this->assertInternalType( 'string', $obj->args[0] );
$this->assertSame( 'unwrapped', $obj->args[0] );
@ -56,5 +62,7 @@ class ObjectFactoryTest extends PHPUnit_Framework_TestCase {
class ObjectFactoryTest_Fixture {
public $args;
public function __construct( /*...*/ ) { $this->args = func_get_args(); }
public function __construct( /*...*/ ) {
$this->args = func_get_args();
}
}

View file

@ -141,12 +141,12 @@ class SiteImporterTest extends PHPUnit_Framework_TestCase {
/**
* @dataProvider provideImportFromXML
*/
public function testImportFromXML( $xml, array $expectedSites, $errorCount = 0 ) {
public function testImportFromXML( $xml, array $expectedSites, $errorCount = 0 ) {
$importer = $this->newSiteImporter( $expectedSites, $errorCount );
$importer->importFromXML( $xml );
}
public function testImportFromXML_malformed() {
public function testImportFromXML_malformed() {
$this->setExpectedException( 'Exception' );
$store = $this->getMock( 'SiteStore' );
@ -154,7 +154,7 @@ class SiteImporterTest extends PHPUnit_Framework_TestCase {
$importer->importFromXML( 'THIS IS NOT XML' );
}
public function testImportFromFile() {
public function testImportFromFile() {
$foo = Site::newForType( Site::TYPE_UNKNOWN );
$foo->setGlobalId( 'Foo' );