Fix braces code style
authorVivek Ghaisas <v.a.ghaisas@gmail.com>
Wed, 17 Jun 2015 13:28:51 +0000 (16:28 +0300)
committerVivek Ghaisas <v.a.ghaisas@gmail.com>
Wed, 17 Jun 2015 13:28:51 +0000 (16:28 +0300)
Bug: T102805
Change-Id: I7ce4c71dd605f9be79a630602391271bb269b962

includes/MimeMagic.php
includes/db/DatabaseMssql.php
includes/db/DatabasePostgres.php
includes/libs/eventrelayer/EventRelayer.php
includes/media/MediaTransformInvalidParametersException.php
includes/page/Article.php
includes/profiler/ProfileSection.php
includes/profiler/Profiler.php
tests/phpunit/includes/libs/ObjectFactoryTest.php
tests/phpunit/includes/site/SiteImporterTest.php

index 0d907b7..3b06525 100644 (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' );
index b5b6825..85f1b96 100644 (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 );
        }
 
index 60999e5..9ad76ab 100644 (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 {
+}
index a3d214f..f95ba3f 100755 (executable)
@@ -26,7 +26,8 @@ abstract class EventRelayer {
        /**
         * @param array $params
         */
-       public function __construct( array $params ) {}
+       public function __construct( array $params ) {
+       }
 
        /**
         * @param string $channel
index 15a2ca5..6f9c291 100644 (file)
@@ -23,4 +23,5 @@
  *
  * @ingroup Exception
  */
-class MediaTransformInvalidParametersException extends MWException {}
+class MediaTransformInvalidParametersException extends MWException {
+}
index 11a3638..5d7f365 100644 (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 ) {
index 9062251..d787edb 100644 (file)
@@ -39,5 +39,6 @@ class ProfileSection {
         *
         * @param string $name Name of the function to profile
         */
-       public function __construct( $name ) {}
+       public function __construct( $name ) {
+       }
 }
index 9983fec..c65a3f9 100644 (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).
index 9220732..a9d3cc1 100644 (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();
+       }
 }
index 64b195d..b11b1a9 100644 (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' );