mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 05:44:04 +00:00
fix 1267: early return in runForMultiple if an empty array is passed
This commit is contained in:
parent
f955b38e2b
commit
c30fb5d092
1 changed files with 4 additions and 2 deletions
|
|
@ -204,8 +204,10 @@ class Tenancy
|
|||
// Wrap string in array
|
||||
$tenants = is_string($tenants) ? [$tenants] : $tenants;
|
||||
|
||||
// Use all tenants if $tenants is falsy
|
||||
$tenants = $tenants ?: $this->model()->cursor(); // todo@phpstan phpstan thinks this isn't needed, but tests fail without it
|
||||
// If $tenants is falsy by this point (e.g. an empty array) there's no work to be done
|
||||
if (! $tenants) {
|
||||
return;
|
||||
}
|
||||
|
||||
$originalTenant = $this->tenant;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue