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

phpstan fixes

This commit is contained in:
Samuel Štancl 2025-01-05 15:50:30 +01:00
parent 3c183e45d9
commit f955b38e2b
12 changed files with 24 additions and 21 deletions

View file

@ -7,6 +7,7 @@ namespace Stancl\Tenancy;
use Closure;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Foundation\Bus\PendingDispatch;
use Illuminate\Support\Traits\Macroable;
use Stancl\Tenancy\Concerns\DealsWithRouteContexts;
use Stancl\Tenancy\Concerns\ManagesRLSPolicies;
@ -71,7 +72,7 @@ class Tenancy
*
* @template T
* @param Closure(Tenant): T $callback
* @return T
* @return (T is PendingDispatch ? null : T)
*/
public function run(Tenant $tenant, Closure $callback): mixed
{
@ -80,7 +81,7 @@ class Tenancy
$this->initialize($tenant);
$result = $callback($tenant);
if ($result instanceof \Illuminate\Foundation\Bus\PendingDispatch) { // #1277
if ($result instanceof PendingDispatch) { // #1277
$result = null;
}