public static function getByMimeType(?string $mimeType): int
    {
        switch (explode('/', (string) $mimeType)[0] ?? null) {
            case 'image':
                return static::IMAGE;
            case 'audio':
                return static::AUDIO;
            case 'video':
                return static::VIDEO;
            default:
                return static::FILE;
        }
    }
public static function getByMimeType(?string $mimeType): int
    {
        switch (explode('/', (string) $mimeType)[0] ?? null) {
            case 'image':
                return static::IMAGE;
            case 'audio':
                return static::AUDIO;
            case 'video':
                return static::VIDEO;
            default:
                return static::FILE;
        }
    }
public static function getByMimeType ( ? string $ mimeType ) : int { switch ( explode ( '/' , ( string ) $ mimeType ) [ 0 ] ?? null ) { case 'image' : return static :: IMAGE ; case 'audio' : return static :: AUDIO ; case 'video' : return static :: VIDEO ; default : return static :: FILE ; } }
Returns file type by its mime type.
@param string|null $mimeType
@return int
Returns file type by its mime type .