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

resolve phpstan issues

This commit is contained in:
Samuel Štancl 2023-02-01 06:17:19 +01:00
parent 66c7d6a066
commit 0a205dd817
2 changed files with 7 additions and 0 deletions

View file

@ -23,6 +23,7 @@ parameters:
- src/Commands/ClearPendingTenants.php - src/Commands/ClearPendingTenants.php
- src/Database/Concerns/PendingScope.php - src/Database/Concerns/PendingScope.php
- src/Database/ParentModelScope.php - src/Database/ParentModelScope.php
- '#Call to an undefined method Illuminate\\Database\\Eloquent\\Builder\:\:withPending\(\)#'
- -
message: '#invalid type Laravel\\Telescope\\IncomingEntry#' message: '#invalid type Laravel\\Telescope\\IncomingEntry#'
paths: paths:
@ -47,9 +48,14 @@ parameters:
message: '#Trying to invoke Closure\|null but it might not be a callable#' message: '#Trying to invoke Closure\|null but it might not be a callable#'
paths: paths:
- src/Database/DatabaseConfig.php - 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#' - '#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\:\:\$tenancy#'
- '#Access to an undefined property Stancl\\Tenancy\\Middleware\\IdentificationMiddleware\:\:\$resolver#' - '#Access to an undefined property Stancl\\Tenancy\\Middleware\\IdentificationMiddleware\:\:\$resolver#'
checkMissingIterableValueType: false checkMissingIterableValueType: false
checkGenericClassInNonGenericObjectType: false # later we may want to enable this
treatPhpDocTypesAsCertain: false treatPhpDocTypesAsCertain: false

View file

@ -113,6 +113,7 @@ class Tenancy
*/ */
public static function find(int|string $id): Tenant|null public static function find(int|string $id): Tenant|null
{ {
/** @var (Tenant&Model)|null */
$tenant = static::model()->where(static::model()->getTenantKeyName(), $id)->first(); $tenant = static::model()->where(static::model()->getTenantKeyName(), $id)->first();
return $tenant; return $tenant;