44
55use Illuminate \Console \Command ;
66use Illuminate \Support \Collection ;
7+
8+ use function Laravel \Prompts \confirm ;
9+ use function Laravel \Prompts \progress ;
10+ use function Laravel \Prompts \table ;
11+
712use Msamgan \LaravelEnvKeysChecker \Actions \AddKeys ;
813use Msamgan \LaravelEnvKeysChecker \Actions \CheckKeys ;
914use Msamgan \LaravelEnvKeysChecker \Actions \GetKeys ;
1015use Msamgan \LaravelEnvKeysChecker \Concerns \HelperFunctions ;
11- use function Laravel \Prompts \confirm ;
12- use function Laravel \Prompts \progress ;
13- use function Laravel \Prompts \table ;
1416
1517class KeysCheckerCommand extends Command
1618{
@@ -30,8 +32,8 @@ public function handle(GetKeys $getKeys, CheckKeys $checkKeys, AddKeys $addKeys)
3032
3133 $ autoAddStrategy = $ autoAddOption ?: config ('env-keys-checker.auto_add ' , 'ask ' );
3234
33- if (!in_array ($ autoAddStrategy , $ autoAddAvailableOptions )) {
34- if (!$ this ->option ('no-display ' )) {
35+ if (! in_array ($ autoAddStrategy , $ autoAddAvailableOptions )) {
36+ if (! $ this ->option ('no-display ' )) {
3537 $ this ->showFailureInfo (
3638 message: 'Invalid auto add option provided. Available options are: ' . implode (', ' , $ autoAddAvailableOptions )
3739 );
@@ -41,7 +43,7 @@ public function handle(GetKeys $getKeys, CheckKeys $checkKeys, AddKeys $addKeys)
4143 }
4244
4345 if (empty ($ envFiles )) {
44- if (!$ this ->option ('no-display ' )) {
46+ if (! $ this ->option ('no-display ' )) {
4547 $ this ->showFailureInfo (
4648 message: 'No .env files found. '
4749 );
@@ -51,11 +53,11 @@ public function handle(GetKeys $getKeys, CheckKeys $checkKeys, AddKeys $addKeys)
5153 }
5254
5355 $ envFiles = collect ($ envFiles )->filter (function ($ file ) use ($ ignoredFiles ) {
54- return !in_array (basename ($ file ), $ ignoredFiles );
56+ return ! in_array (basename ($ file ), $ ignoredFiles );
5557 })->toArray ();
5658
5759 if (empty ($ envFiles )) {
58- if (!$ this ->option ('no-display ' )) {
60+ if (! $ this ->option ('no-display ' )) {
5961 $ this ->showFailureInfo (
6062 message: 'No .env files found. '
6163 );
@@ -68,7 +70,7 @@ public function handle(GetKeys $getKeys, CheckKeys $checkKeys, AddKeys $addKeys)
6870
6971 $ missingKeys = collect ();
7072
71- $ processKeys = fn ($ key ) => $ checkKeys ->handle (keyData: $ key , envFiles: $ envFiles , missingKeys: $ missingKeys );
73+ $ processKeys = fn ($ key ) => $ checkKeys ->handle (keyData: $ key , envFiles: $ envFiles , missingKeys: $ missingKeys );
7274
7375 if ($ this ->option ('no-progress ' )) {
7476 $ keys ->each ($ processKeys );
@@ -82,7 +84,7 @@ public function handle(GetKeys $getKeys, CheckKeys $checkKeys, AddKeys $addKeys)
8284 }
8385
8486 if ($ missingKeys ->isEmpty ()) {
85- if (!$ this ->option ('no-display ' )) {
87+ if (! $ this ->option ('no-display ' )) {
8688 $ this ->showSuccessInfo (
8789 message: 'All keys are present in all .env files. '
8890 );
@@ -91,7 +93,7 @@ public function handle(GetKeys $getKeys, CheckKeys $checkKeys, AddKeys $addKeys)
9193 return self ::SUCCESS ;
9294 }
9395
94- if (!$ this ->option ('no-display ' )) {
96+ if (! $ this ->option ('no-display ' )) {
9597 $ this ->showMissingKeysTable ($ missingKeys );
9698 }
9799
@@ -101,7 +103,7 @@ public function handle(GetKeys $getKeys, CheckKeys $checkKeys, AddKeys $addKeys)
101103 if ($ confirmation ) {
102104 $ addKeys ->handle (missingKeys: $ missingKeys );
103105
104- if (!$ this ->option ('no-display ' )) {
106+ if (! $ this ->option ('no-display ' )) {
105107 $ this ->showSuccessInfo ('All missing keys have been added to the .env files. ' );
106108 }
107109 }
0 commit comments