public function isAcceptable($mimeType, array $acceptable) {
        foreach ($acceptable as $type => $q) {
            $pattern = '#^' . str_replace('*', '.*', $type) . '#';

            if (preg_match($pattern, $mimeType)) {
                return $q;
            }
        }

        return false;
    }