|
4 | 4 |
|
5 | 5 | use Illuminate\Support\Collection; |
6 | 6 | use STS\Keep\Commands\Concerns\GathersInput; |
| 7 | +use STS\Keep\Data\Collections\SecretCollection; |
7 | 8 | use STS\Keep\Data\SecretDiff; |
8 | 9 | use STS\Keep\Facades\Keep; |
9 | | -use STS\Keep\Services\DiffService; |
10 | 10 |
|
11 | 11 | use function Laravel\Prompts\spin; |
12 | 12 | use function Laravel\Prompts\table; |
@@ -41,11 +41,10 @@ public function process() |
41 | 41 | return self::FAILURE; |
42 | 42 | } |
43 | 43 |
|
44 | | - $diffService = new DiffService; |
45 | | - $diffs = spin(fn () => $diffService->compare($vaults, $stages, $this->option('only'), $this->option('except')), 'Gathering secrets for comparison...'); |
| 44 | + $diffs = spin(fn () => SecretCollection::compare($vaults, $stages, $this->option('only'), $this->option('except')), 'Gathering secrets for comparison...'); |
46 | 45 |
|
47 | 46 | if ($diffs->isNotEmpty()) { |
48 | | - $this->displayTable($diffs, $vaults, $stages, $diffService); |
| 47 | + $this->displayTable($diffs, $vaults, $stages); |
49 | 48 | } else { |
50 | 49 | $this->info('No secrets found in any of the specified vault/stage combinations.'); |
51 | 50 | } |
@@ -92,7 +91,7 @@ protected function getStagesToCompare(): array |
92 | 91 | return Keep::getStages(); |
93 | 92 | } |
94 | 93 |
|
95 | | - protected function displayTable(Collection $diffs, array $vaults, array $stages, DiffService $diffService): void |
| 94 | + protected function displayTable(Collection $diffs, array $vaults, array $stages): void |
96 | 95 | { |
97 | 96 | $this->newLine(); |
98 | 97 | $this->info('Secret Comparison Matrix'); |
@@ -128,12 +127,12 @@ protected function displayTable(Collection $diffs, array $vaults, array $stages, |
128 | 127 |
|
129 | 128 | table($headers, $rows); |
130 | 129 |
|
131 | | - $this->displaySummary($diffs, $vaults, $stages, $diffService); |
| 130 | + $this->displaySummary($diffs, $vaults, $stages); |
132 | 131 | } |
133 | 132 |
|
134 | | - protected function displaySummary(Collection $diffs, array $vaults, array $stages, DiffService $diffService): void |
| 133 | + protected function displaySummary(Collection $diffs, array $vaults, array $stages): void |
135 | 134 | { |
136 | | - $summary = $diffService->generateSummary($diffs, $vaults, $stages); |
| 135 | + $summary = SecretCollection::generateDiffSummary($diffs, $vaults, $stages); |
137 | 136 |
|
138 | 137 | $this->info('Summary:'); |
139 | 138 | $this->line("• Total secrets: {$summary['total_secrets']}"); |
|
0 commit comments