1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 15:34:03 +00:00

Make sure an int exit code is always returned

This commit is contained in:
Samuel Štancl 2020-04-22 22:31:51 +02:00 committed by GitHub
parent 4a537672d8
commit cb6661210f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,14 +14,8 @@ trait TenantAwareCommand
protected function execute(InputInterface $input, OutputInterface $output) protected function execute(InputInterface $input, OutputInterface $output)
{ {
$tenants = $this->getTenants(); $tenants = $this->getTenants();
if (count($tenants) === 1) {
return $tenants[0]->run(function () {
return $this->laravel->call([$this, 'handle']);
});
}
$exitCode = 0; $exitCode = 0;
foreach ($tenants as $tenant) { foreach ($tenants as $tenant) {
$result = (int) $tenant->run(function () { $result = (int) $tenant->run(function () {
return $this->laravel->call([$this, 'handle']); return $this->laravel->call([$this, 'handle']);