public function getIconType(?string $extension): string
    {
        if ($extension !== null && $extension !== '') {
            foreach (self::TYPE_TO_REGEX as $type => $regex) {
                if ($regex === null) {
                    continue;
                }
                if (($regex === $extension && preg_match('/[a-z0-9]+/', $extension))
                    || preg_match("/$regex/", $extension)
                ) {
                    return $type;
                }
            }
        }

        return self::ICON_DEFAULT;
    }