wiki.techinc.nl/includes/libs/mime
Ori Livneh 7e01e86e09 mime: Represent lists as arrays instead of space-delimited strings
Deprecate the interfaces in MimeAnalyzer that return lists as
space-separated strings in favor of replacement methods that return
arrays.

Deprecated:

 - ::getExtensionsForType( $mime ) : string|null
 - ::getTypesForExtension( $ext ) : string|null
 - ::guessTypesForExtension( $ext ) : string|null

Added:

 - ::getExtensionsFromMimeType( $mime ) : string[]
 - ::getMimeTypesFromExtension( $ext ) : string[]
 - ::getExtensionFromMimeTypeOrNull( $mime ) : string|null
 - ::getMimeTypeFromExtensionOrNull( $ext ) : string|null

- "From" is clearer than "For"[1] and is neatly symmetrical with "To"
  (viz. ::mExtToMime and ::mMimeToExt).
- "MimeType" is less ambiguous than "Type", which in this context may
  refer either to media type or MIME type.
- "{..}OrNull" is better because it helps users remember to handle a null
  return value. Putting the "OrNull" at the end (getXFromYOrNull) is
  better than putting it in the middle (getXOrNullFromY) because it's
  harder to ignore that way, at the cost of a very slight grammatical
  ambiguity.

Usage in Core will updated in a separate commit.

Lastly, this change prepares for the deprecation of mutating the public
'mExtToMime' attribute as a means of registering extensions. It will be
formally deprecated in a follow-up change.

  [1]: Positive signal: https://developer.android.com/reference/android/webkit/MimeTypeMap#getMimeTypeFromExtension(java.lang.String)

Bug: T252228
Change-Id: I93bd71ec18492722f05c66e0a2945d93281c3100
2020-05-28 15:15:43 +00:00
..
defines.php Clean up spacing of doc comments 2019-08-05 22:29:50 +00:00
IEContentAnalyzer.php Set method visibility for various constructors 2019-12-03 20:17:30 +01:00
MimeAnalyzer.php mime: Represent lists as arrays instead of space-delimited strings 2020-05-28 15:15:43 +00:00
MimeMap.php mime: Represent lists as arrays instead of space-delimited strings 2020-05-28 15:15:43 +00:00
MimeMapMinimal.php mime: Represent lists as arrays instead of space-delimited strings 2020-05-28 15:15:43 +00:00
MSCompoundFileReader.php Fix more libs PSR12.Properties.ConstantVisibility.NotFound 2020-05-16 20:13:22 +00:00
XmlTypeCheck.php Set method visibility for various constructors 2019-12-03 20:17:30 +01:00