const MAX_ERR_LOG_SIZE = 65535;
/** @var MediaHandler[] Instance cache with array of MediaHandler */
- protected static $handlers = array();
+ protected static $handlers = [];
/**
* Get a MediaHandler for a given MIME type from the instance cache
* Resets all static caches
*/
public static function resetCache() {
- self::$handlers = array();
+ self::$handlers = [];
}
/**
* @return string Version string
*/
static function getMetadataVersion() {
- $version = array( '2' ); // core metadata version
- Hooks::run( 'GetMetadataVersion', array( &$version ) );
+ $version = [ '2' ]; // core metadata version
+ Hooks::run( 'GetMetadataVersion', [ &$version ] );
return implode( ';', $version );
}
// recognize the MIME type
$extensions = $magic->getExtensionsForType( $mime );
if ( $extensions ) {
- return array( strtok( $extensions, ' ' ), $mime );
+ return [ strtok( $extensions, ' ' ), $mime ];
}
}
// The extension is correct (true) or the MIME type is unknown to
// MediaWiki (null)
- return array( $ext, $mime );
+ return [ $ext, $mime ];
}
/**
* @return array
*/
public function getStreamHeaders( $metadata ) {
- return array();
+ return [];
}
/**
function getPageDimensions( File $image, $page ) {
$gis = $this->getImageSize( $image, $image->getLocalRefPath() );
if ( $gis ) {
- return array(
+ return [
'width' => $gis[0],
'height' => $gis[1]
- );
+ ];
} else {
return false;
}
* @return array Array for use displaying metadata.
*/
function formatMetadataHelper( $metadataArray, $context = false ) {
- $result = array(
- 'visible' => array(),
- 'collapsed' => array()
- );
+ $result = [
+ 'visible' => [],
+ 'collapsed' => []
+ ];
$formatted = FormatMetadata::getFormattedData( $metadataArray, $context );
// Sort fields into visible and collapsed
wfDebug( __METHOD__ . ' Unknown metadata name: ' . $id . "\n" );
$name = wfEscapeWikiText( $id );
}
- $array[$visibility][] = array(
+ $array[$visibility][] = [
'id' => "$type-$id",
'name' => $name,
'value' => $value
- );
+ ];
}
/**
* @since 1.23
*/
public function getAvailableLanguages( File $file ) {
- return array();
+ return [];
}
/**