lib/FileWrapper.php
protected function mimeTypoFix($input): string
    {
        if (is_null($this->path)) {
            throw \AWonderPHP\FileWrapper\NullPropertyException::propertyIsNull('path');
        }
        $input = trim($input);
        $mime = $input;
        switch ($input) {
            case 'application/font-woff':
                $mime = 'font/woff';
                break;
            case 'audio/m4a':
                $mime = 'audio/mp4';
                break;
            case 'audio/matroska':
                $mime = 'audio/x-matroska';
                break;
            case 'audio/mp3':
                $mime = 'audio/mpeg';
                break;
            case 'audio/x-aiff':
                $mime = 'audio/aiff';
                break;
            case 'audio/wav':
                $mime = 'audio/x-wav';
                break;
            case 'audio/x-m4a':
                $mime = 'audio/mp4';
                break;
            case 'audio/x-matroska':
                $arr = explode('.', $this->path);
                $ext = strtolower(end($arr));
                switch ($ext) {
                    case 'weba':
                        $mime = 'audio/webm';
                        break;
                }
                break;
            case 'image/jpg':
                $mime = 'image/jpeg';
                break;
            case 'image/tif':
                $mime = 'image/tiff';
                break;
            case 'video/matroska':
                $mime = 'video/x-matroska';
                // test the extension too so no break
            case 'video/x-matroska':
                $arr = explode('.', $this->path);
                $ext = strtolower(end($arr));
                switch ($ext) {
                    case 'mka':
                        $mime = 'audio/x-matroska';
                        break;
                    case 'weba':
                        $mime = 'audio/webm';
                        break;
                    case 'webm':
                        $mime = 'video/webm';
                        break;
                    case 'webm2':
                        $mime = 'video/webm';
                        break;
                }
                break;
            case 'application/octet-stream':
                $arr = explode('.', $this->path);
                $ext = strtolower(end($arr));
                switch ($ext) {
                    case 'opus':
                        $mime = 'audio/ogg';
                        break;
                }
                break;
            case 'text/plain':
                $arr = explode('.', $this->path);
                $ext = strtolower(end($arr));
                switch ($ext) {
                    case 'js':
                        $mime = 'application/javascript';
                        break;
                    case 'css':
                        $mime = 'text/css';
                        break;
                    case 'vtt':
                        $mime = 'text/vtt';
                        break;
                }
                break;
        }
        return $mime;
    }
protected function mimeTypoFix($input): string
    {
        if (is_null($this->path)) {
            throw \AWonderPHP\FileWrapper\NullPropertyException::propertyIsNull('path');
        }
        $input = trim($input);
        $mime = $input;
        switch ($input) {
            case 'application/font-woff':
                $mime = 'font/woff';
                break;
            case 'audio/m4a':
                $mime = 'audio/mp4';
                break;
            case 'audio/matroska':
                $mime = 'audio/x-matroska';
                break;
            case 'audio/mp3':
                $mime = 'audio/mpeg';
                break;
            case 'audio/x-aiff':
                $mime = 'audio/aiff';
                break;
            case 'audio/wav':
                $mime = 'audio/x-wav';
                break;
            case 'audio/x-m4a':
                $mime = 'audio/mp4';
                break;
            case 'audio/x-matroska':
                $arr = explode('.', $this->path);
                $ext = strtolower(end($arr));
                switch ($ext) {
                    case 'weba':
                        $mime = 'audio/webm';
                        break;
                }
                break;
            case 'image/jpg':
                $mime = 'image/jpeg';
                break;
            case 'image/tif':
                $mime = 'image/tiff';
                break;
            case 'video/matroska':
                $mime = 'video/x-matroska';
                // test the extension too so no break
            case 'video/x-matroska':
                $arr = explode('.', $this->path);
                $ext = strtolower(end($arr));
                switch ($ext) {
                    case 'mka':
                        $mime = 'audio/x-matroska';
                        break;
                    case 'weba':
                        $mime = 'audio/webm';
                        break;
                    case 'webm':
                        $mime = 'video/webm';
                        break;
                    case 'webm2':
                        $mime = 'video/webm';
                        break;
                }
                break;
            case 'application/octet-stream':
                $arr = explode('.', $this->path);
                $ext = strtolower(end($arr));
                switch ($ext) {
                    case 'opus':
                        $mime = 'audio/ogg';
                        break;
                }
                break;
            case 'text/plain':
                $arr = explode('.', $this->path);
                $ext = strtolower(end($arr));
                switch ($ext) {
                    case 'js':
                        $mime = 'application/javascript';
                        break;
                    case 'css':
                        $mime = 'text/css';
                        break;
                    case 'vtt':
                        $mime = 'text/vtt';
                        break;
                }
                break;
        }
        return $mime;
    }
Fixes common programmer typos and less than precise mime types from fileinfo.so.

@param string $input The MIME type to be checked and possibly fixed.

@return string Either the input MIME type or a correction of it.