File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -185,7 +185,7 @@ class InitCommand extends Ahc\Cli\Input\Command
185185 }
186186
187187 // This method is auto called before `self::execute()` and receives `Interactor $io` instance
188- public function interact(Ahc\Cli\IO\Interactor $io)
188+ public function interact(Ahc\Cli\IO\Interactor $io) : void
189189 {
190190 // Collect missing opts/args
191191 if (!$this->apple) {
@@ -216,7 +216,21 @@ class InitCommand extends Ahc\Cli\Input\Command
216216
217217class OtherCommand extends Ahc\Cli\Input\Command
218218{
219- // ...
219+ public function __construct()
220+ {
221+ parent::__construct('other', 'Other something');
222+ }
223+
224+ public function execute()
225+ {
226+ $io = $this->app()->io();
227+
228+ $io->write('Other command');
229+
230+ // more codes ...
231+
232+ // If you return integer from here, that will be taken as exit error code
233+ }
220234}
221235
222236// Init App with name and version
You can’t perform that action at this time.
0 commit comments