public static function mediaRangeMatches(string $mediaRange, string $mediaType): bool
    {
        preg_match(self::PATTERN_SPLITMEDIARANGE, $mediaRange, $mediaRangeMatches);
        preg_match(self::PATTERN_SPLITMEDIATYPE, $mediaType, $mediaTypeMatches);
        if ($mediaRangeMatches === [] || $mediaTypeMatches === []) {
            return false;
        }

        $typeMatches = ($mediaRangeMatches['type'] === '*' || $mediaRangeMatches['type'] === $mediaTypeMatches['type']);
        $subtypeMatches = ($mediaRangeMatches['subtype'] === '*' || $mediaRangeMatches['subtype'] === $mediaTypeMatches['subtype']);

        return ($typeMatches && $subtypeMatches);
    }