mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 08:24:05 +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
|
// Wrap string in array
|
||||||
$tenants = is_string($tenants) ? [$tenants] : $tenants;
|
$tenants = is_string($tenants) ? [$tenants] : $tenants;
|
||||||
|
|
||||||
// Use all tenants if $tenants is falsy
|
// If $tenants is falsy by this point (e.g. an empty array) there's no work to be done
|
||||||
$tenants = $tenants ?: $this->model()->cursor(); // todo@phpstan phpstan thinks this isn't needed, but tests fail without it
|
if (! $tenants) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$originalTenant = $this->tenant;
|
$originalTenant = $this->tenant;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue