/**
* 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' );
* @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 );
}
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 );
}
}
} // end DatabasePostgres class
-class PostgresBlob extends Blob {}
+class PostgresBlob extends Blob {
+}
/**
* @param array $params
*/
- public function __construct( array $params ) {}
+ public function __construct( array $params ) {
+ }
/**
* @param string $channel
*
* @ingroup Exception
*/
-class MediaTransformInvalidParametersException extends MWException {}
+class MediaTransformInvalidParametersException extends MWException {
+}
* @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 ) {
*
* @param string $name Name of the function to profile
*/
- public function __construct( $name ) {}
+ public function __construct( $name ) {
+ }
}
}
// 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).
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] );
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] );
$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] );
class ObjectFactoryTest_Fixture {
public $args;
- public function __construct( /*...*/ ) { $this->args = func_get_args(); }
+ public function __construct( /*...*/ ) {
+ $this->args = func_get_args();
+ }
}
/**
* @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' );
$importer->importFromXML( 'THIS IS NOT XML' );
}
- public function testImportFromFile() {
+ public function testImportFromFile() {
$foo = Site::newForType( Site::TYPE_UNKNOWN );
$foo->setGlobalId( 'Foo' );