@@ -42,21 +42,21 @@ public function isEnabled(): bool
42
42
return class_exists (Key::class);
43
43
}
44
44
45
- protected function execute (InputInterface $ input , OutputInterface $ output )
45
+ protected function execute (InputInterface $ input , OutputInterface $ output ): int
46
46
{
47
47
$ io = new SymfonyStyle ($ input , $ output );
48
48
if (!$ configFile = $ input ->getOption ('config-file ' )) {
49
49
$ io ->error ('Please specify a config file ' );
50
50
51
- return 1 ;
51
+ return self :: FAILURE ;
52
52
}
53
53
$ encryptionKey = $ input ->getOption ('encryption-key ' );
54
54
if (empty ($ encryptionKey )) {
55
55
$ generateKey = $ io ->confirm ('No encryption key given. Should a new one be generated? ' , false );
56
56
if (!$ generateKey ) {
57
57
$ io ->error ('No key given, cannot encrypt config file ' );
58
58
59
- return 1 ;
59
+ return self :: FAILURE ;
60
60
}
61
61
$ encryptionKey = Key::createNewRandomKey ()->saveToAsciiSafeString ();
62
62
$ io ->warning ('Generated new encryption key ' );
@@ -79,13 +79,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
79
79
if ($ encryptedConfig === $ originalConfig ) {
80
80
$ io ->warning (sprintf ('No values found to encrypt in file "%s" ' , $ input ->getOption ('config-file ' )));
81
81
82
- return 1 ;
82
+ return self :: FAILURE ;
83
83
}
84
84
$ configDumper = new ConfigDumper ();
85
85
$ configDumper ->dumpToFile ($ encryptedConfig , $ configFile );
86
86
87
87
$ io ->success (sprintf ('Encrypted values in file "%s" ' , $ input ->getOption ('config-file ' )));
88
88
89
- return 0 ;
89
+ return self :: SUCCESS ;
90
90
}
91
91
}
0 commit comments