private function clearCache($key)
    {
        $allowedCacheKeys = [
            self::CACHE_KEY_CSS,
            self::CACHE_KEY_SELECTOR,
            self::CACHE_KEY_XPATH,
            self::CACHE_KEY_CSS_DECLARATIONS_BLOCK,
            self::CACHE_KEY_COMBINED_STYLES,
        ];
        if (!in_array($key, $allowedCacheKeys, true)) {
            throw new \InvalidArgumentException('Invalid cache key: ' . $key, 1391822035);
        }

        $this->caches[$key] = [];
    }