*
* File must be in the path returned by getFilePath()
* @param string $name File name
- * @param string $type MIME type [optional]
+ * @param string|null $type MIME type [optional]
* @return UnregisteredLocalFile
*/
protected function dataFile( $name, $type = null ) {
if ( !$type ) {
// Autodetect by file extension for the lazy.
- $magic = MimeMagic::singleton();
+ $magic = MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer();
$parts = explode( $name, '.' );
$type = $magic->guessTypesForExtension( $parts[count( $parts ) - 1] );
}