11
11
use Magento \Framework \Module \FullModuleList ;
12
12
use Magento \Framework \Module \ModuleList ;
13
13
use Magento \Setup \Model \ObjectManagerProvider ;
14
+ use Magento \Framework \Console \Cli ;
14
15
use Symfony \Component \Console \Input \InputInterface ;
15
16
use Symfony \Component \Console \Output \OutputInterface ;
16
17
use Symfony \Component \Console \Input \InputArgument ;
@@ -89,13 +90,13 @@ private function showSpecificModule(string $moduleName, OutputInterface $output)
89
90
$ allModules = $ this ->getAllModules ();
90
91
if (!in_array ($ moduleName , $ allModules ->getNames ())) {
91
92
$ output ->writeln ('<error>Module does not exist</error> ' );
92
- return ;
93
+ return Cli:: RETURN_FAILURE ;
93
94
}
94
95
95
96
$ enabledModules = $ this ->getEnabledModules ();
96
97
if (in_array ($ moduleName , $ enabledModules ->getNames ())) {
97
98
$ output ->writeln ('<info>Module is enabled</info> ' );
98
- return ;
99
+ return Cli:: RETURN_FAILURE ;
99
100
}
100
101
101
102
$ output ->writeln ('<info>Module is disabled</info> ' );
@@ -110,9 +111,10 @@ private function showEnabledModules(OutputInterface $output)
110
111
$ enabledModuleNames = $ enabledModules ->getNames ();
111
112
if (count ($ enabledModuleNames ) === 0 ) {
112
113
$ output ->writeln ('None ' );
113
- } else {
114
- $ output ->writeln (join ("\n" , $ enabledModuleNames ));
114
+ return Cli::RETURN_FAILURE ;
115
115
}
116
+
117
+ $ output ->writeln (join ("\n" , $ enabledModuleNames ));
116
118
}
117
119
118
120
/**
@@ -123,9 +125,10 @@ private function showDisabledModules(OutputInterface $output)
123
125
$ disabledModuleNames = $ this ->getDisabledModuleNames ();
124
126
if (count ($ disabledModuleNames ) === 0 ) {
125
127
$ output ->writeln ('None ' );
126
- } else {
127
- $ output ->writeln (join ("\n" , $ disabledModuleNames ));
128
+ return Cli::RETURN_FAILURE ;
128
129
}
130
+
131
+ $ output ->writeln (join ("\n" , $ disabledModuleNames ));
129
132
}
130
133
131
134
/**
0 commit comments