From 0a205dd81721ba92a83f50d7085d5fdff1d775ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Wed, 1 Feb 2023 06:17:19 +0100 Subject: [PATCH] resolve phpstan issues --- phpstan.neon | 6 ++++++ src/Tenancy.php | 1 + 2 files changed, 7 insertions(+) diff --git a/phpstan.neon b/phpstan.neon index 7ae06b44..91e9f3af 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -23,6 +23,7 @@ parameters: - src/Commands/ClearPendingTenants.php - src/Database/Concerns/PendingScope.php - src/Database/ParentModelScope.php + - '#Call to an undefined method Illuminate\\Database\\Eloquent\\Builder\:\:withPending\(\)#' - message: '#invalid type Laravel\\Telescope\\IncomingEntry#' paths: @@ -47,9 +48,14 @@ parameters: message: '#Trying to invoke Closure\|null but it might not be a callable#' paths: - src/Database/DatabaseConfig.php + - + message: '#Unable to resolve the template type (TMapWithKeysKey|TMapWithKeysValue) in call to method#' + paths: + - src/Concerns/DealsWithTenantSymlinks.php - '#Method Stancl\\Tenancy\\Tenancy::cachedResolvers\(\) should return array#' - '#Access to an undefined property Stancl\\Tenancy\\Middleware\\IdentificationMiddleware\:\:\$tenancy#' - '#Access to an undefined property Stancl\\Tenancy\\Middleware\\IdentificationMiddleware\:\:\$resolver#' checkMissingIterableValueType: false + checkGenericClassInNonGenericObjectType: false # later we may want to enable this treatPhpDocTypesAsCertain: false diff --git a/src/Tenancy.php b/src/Tenancy.php index 98373203..6de52c42 100644 --- a/src/Tenancy.php +++ b/src/Tenancy.php @@ -113,6 +113,7 @@ class Tenancy */ public static function find(int|string $id): Tenant|null { + /** @var (Tenant&Model)|null */ $tenant = static::model()->where(static::model()->getTenantKeyName(), $id)->first(); return $tenant;