@@ -32,19 +32,25 @@ public function process()
3232 }
3333
3434 if (empty ($ vaults )) {
35- return $ this ->error ('No vaults available for comparison. ' );
35+ $ this ->error ('No vaults available for comparison. ' );
36+ return self ::FAILURE ;
3637 }
3738
3839 if (empty ($ stages )) {
39- return $ this ->error ('No stages available for comparison. ' );
40+ $ this ->error ('No stages available for comparison. ' );
41+ return self ::FAILURE ;
4042 }
4143
4244 $ diffService = new DiffService ;
4345 $ diffs = spin (fn () => $ diffService ->compare ($ vaults , $ stages ), 'Gathering secrets for comparison... ' );
4446
45- return $ diffs ->isNotEmpty ()
46- ? $ this ->displayTable ($ diffs , $ vaults , $ stages , $ diffService )
47- : $ this ->info ('No secrets found in any of the specified vault/stage combinations. ' );
47+ if ($ diffs ->isNotEmpty ()) {
48+ $ this ->displayTable ($ diffs , $ vaults , $ stages , $ diffService );
49+ return self ::SUCCESS ;
50+ } else {
51+ $ this ->info ('No secrets found in any of the specified vault/stage combinations. ' );
52+ return self ::SUCCESS ;
53+ }
4854 }
4955
5056 protected function getVaultsToCompare (): array
@@ -87,14 +93,14 @@ protected function getStagesToCompare(): array
8793 return Keep::getStages ();
8894 }
8995
90- protected function displayTable (Collection $ diffs , array $ vaults , array $ stages , DiffService $ diffService ): bool
96+ protected function displayTable (Collection $ diffs , array $ vaults , array $ stages , DiffService $ diffService ): void
9197 {
9298 $ this ->newLine ();
9399 $ this ->info ('Secret Comparison Matrix ' );
94100
95101 // Build column headers
96102 $ headers = ['Key ' ];
97- $ vaultEnvCombinations = [];
103+ $ vaultStageCombinations = [];
98104
99105 foreach ($ vaults as $ vault ) {
100106 foreach ($ stages as $ stage ) {
@@ -124,8 +130,6 @@ protected function displayTable(Collection $diffs, array $vaults, array $stages,
124130 table ($ headers , $ rows );
125131
126132 $ this ->displaySummary ($ diffs , $ vaults , $ stages , $ diffService );
127-
128- return true ;
129133 }
130134
131135 protected function displaySummary (Collection $ diffs , array $ vaults , array $ stages , DiffService $ diffService ): void
0 commit comments