Skip to content

Commit 22a278e

Browse files
committed
fix: exit after invalid rollback type
1 parent b20bd4c commit 22a278e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Commands/RollbackGeneratorCommand.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function __construct()
6161
/**
6262
* Execute the command.
6363
*
64-
* @return void
64+
* @return int
6565
*/
6666
public function handle()
6767
{
@@ -72,6 +72,7 @@ public function handle()
7272
CommandData::$COMMAND_TYPE_API_SCAFFOLD,
7373
])) {
7474
$this->error('invalid rollback type');
75+
return 1;
7576
}
7677

7778
$this->commandData = new CommandData($this, $this->argument('type'));
@@ -90,7 +91,7 @@ public function handle()
9091
$this->composer->dumpOptimized();
9192
$this->commandData->fireEvent($type, FileUtil::FILE_DELETED);
9293

93-
return;
94+
return 0;
9495
}
9596

9697
$migrationGenerator = new MigrationGenerator($this->commandData);
@@ -143,6 +144,7 @@ public function handle()
143144
$this->composer->dumpOptimized();
144145

145146
$this->commandData->fireEvent($type, FileUtil::FILE_DELETED);
147+
return 0;
146148
}
147149

148150
/**

0 commit comments

Comments
 (0)