*/ private const GROUP_LABELS = [ 'staging' => '업데이트 스테이징 잔존', 'temp' => '코어 임시 산출물', 'vendor_bundle_staging' => 'vendor 번들 스테이징', 'extension_backups' => '확장 백업', 'core_backups' => '코어 백업', 'legacy_browser_log' => '레거시 브라우저 로그', ]; /** * Execute the console command. * * @param StorageLeftoverPruneService $service 잔존물 정리 서비스 * @return int 명령 실행 결과 코드 */ public function handle(StorageLeftoverPruneService $service): int { $days = max(0, (int) $this->option('days')); $backupDays = max(0, (int) $this->option('backup-days')); $dryRun = (bool) $this->option('dry-run'); $result = $service->prune($days, $backupDays, $dryRun); $total = 0; foreach (self::GROUP_LABELS as $key => $label) { $paths = $result[$key] ?? []; $count = count($paths); $total += $count; $this->line("{$label}: {$count}건"); if ($dryRun) { foreach ($paths as $path) { $this->line(" - {$path}"); } } } $this->info($dryRun ? "삭제 대상 합계 {$total}건 (dry-run — 실제 삭제 없음)" : "합계 {$total}건이 삭제되었습니다. (임시 보존일: {$days}일, 백업 보존일: {$backupDays}일)"); return self::SUCCESS; } }