public static function getMimeType( $file ) {
// Infer the MIME-type from the file extension
$ext = strtolower( pathinfo( $file, PATHINFO_EXTENSION ) );
- if ( isset( self::$mimeTypes[$ext] ) ) {
- return self::$mimeTypes[$ext];
- }
-
- return mime_content_type( realpath( $file ) );
+ return self::$mimeTypes[$ext] ?? mime_content_type( realpath( $file ) );
}
/**