isFile() && $file->getExtension() === 'php') { $path = $file->getPathname(); $content = file_get_contents($path); $newContent = preg_replace('/hover:bg-zinc-50(?:\s+dark:hover:bg-[a-z0-9\/]+)?\s+transition-colors/', 'hover:bg-zinc-50 dark:hover:bg-transparent transition-colors', $content); // Try simple replace if regex missed it due to newlines if ($content === $newContent) { $newContent = str_replace('hover:bg-zinc-50 transition-colors', 'hover:bg-zinc-50 dark:hover:bg-transparent transition-colors', $content); } if ($content !== $newContent) { file_put_contents($path, $newContent); $count++; echo "Updated: $path\n"; } } } echo "Total updated: $count files.\n";