/** The singleton instance
*/
- private static $instance;
+ private static $instance = null;
/** Initializes the MimeMagic object. This is called by MimeMagic::singleton().
*
* Get an instance of this class
* @return MimeMagic
*/
- public static function &singleton() {
+ public static function singleton() {
if ( self::$instance === null ) {
self::$instance = new MimeMagic;
}
// trust the file extension
$mime = $this->guessTypesForExtension( $ext );
}
- }
- elseif ( $mime === 'application/x-opc+zip' ) {
+ } elseif ( $mime === 'application/x-opc+zip' ) {
if ( $this->isMatchingExtension( $ext, $mime ) ) {
// A known file extension for an OPC file,
// find the proper mime type for that file extension
* based formats like OPC/ODF files).
*
* @param string $file the file to check
- * @param $ext Mixed: the file extension, or true (default) to extract it from the filename.
- * Set it to false to ignore the extension. DEPRECATED! Set to false, use
- * improveTypeFromExtension($mime, $ext) later to improve mime type.
+ * @param string|bool $ext The file extension, or true (default) to extract it from the filename.
+ * Set it to false to ignore the extension. DEPRECATED! Set to false, use
+ * improveTypeFromExtension($mime, $ext) later to improve mime type.
*
* @return string the mime type of $file
*/
* header data. Currently works for OpenDocument and OpenXML types...
* If can't tell, returns 'application/zip'.
*
- * @param string $header some reasonably-sized chunk of file header
- * @param $tail String: the tail of the file
- * @param $ext Mixed: the file extension, or true to extract it from the filename.
- * Set it to false (default) to ignore the extension. DEPRECATED! Set to false,
- * use improveTypeFromExtension($mime, $ext) later to improve mime type.
+ * @param string $header Some reasonably-sized chunk of file header
+ * @param string|null $tail The tail of the file
+ * @param string|bool $ext The file extension, or true to extract it from the filename.
+ * Set it to false (default) to ignore the extension. DEPRECATED! Set to false,
+ * use improveTypeFromExtension($mime, $ext) later to improve mime type.
*
* @return string
*/
* mime type if the file is an image. If no mime type can be determined,
* this function returns 'unknown/unknown'.
*
- * @param string $file the file to check
- * @param $ext Mixed: the file extension, or true (default) to extract it from the filename.
- * Set it to false to ignore the extension. DEPRECATED! Set to false, use
- * improveTypeFromExtension($mime, $ext) later to improve mime type.
+ * @param string $file The file to check
+ * @param string|bool $ext The file extension, or true (default) to extract it from the filename.
+ * Set it to false to ignore the extension. DEPRECATED! Set to false, use
+ * improveTypeFromExtension($mime, $ext) later to improve mime type.
*
* @return string the mime type of $file
*/