From 6b6c883234ace5d8205977c4a9e3a2b8581a6194 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Thu, 4 Jul 2024 20:48:55 +0200 Subject: [PATCH] phpstan fixes --- phpstan.neon | 4 ---- src/Contracts/TenantCouldNotBeIdentifiedException.php | 4 ++-- src/Database/Concerns/PendingScope.php | 6 +++--- src/Database/ParentModelScope.php | 2 +- src/Database/TenantScope.php | 2 +- 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/phpstan.neon b/phpstan.neon index cb6b2e3e..082a22fe 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -28,10 +28,6 @@ parameters: message: '#invalid type Laravel\\Telescope\\IncomingEntry#' paths: - src/Features/TelescopeTags.php - - - message: '#Parameter \#1 \$key of method Illuminate\\Cache\\Repository::put\(\) expects#' - paths: - - src/helpers.php - message: '#PHPDoc tag \@param has invalid value \(dynamic#' paths: diff --git a/src/Contracts/TenantCouldNotBeIdentifiedException.php b/src/Contracts/TenantCouldNotBeIdentifiedException.php index 011d974b..a83a0c75 100644 --- a/src/Contracts/TenantCouldNotBeIdentifiedException.php +++ b/src/Contracts/TenantCouldNotBeIdentifiedException.php @@ -5,8 +5,8 @@ declare(strict_types=1); namespace Stancl\Tenancy\Contracts; use Exception; -use Spatie\Ignition\Contracts\BaseSolution; -use Spatie\Ignition\Contracts\ProvidesSolution; +use Spatie\ErrorSolutions\Contracts\BaseSolution; +use Spatie\ErrorSolutions\Contracts\ProvidesSolution; abstract class TenantCouldNotBeIdentifiedException extends Exception implements ProvidesSolution { diff --git a/src/Database/Concerns/PendingScope.php b/src/Database/Concerns/PendingScope.php index 8a6ad913..d9bbd17f 100644 --- a/src/Database/Concerns/PendingScope.php +++ b/src/Database/Concerns/PendingScope.php @@ -52,7 +52,7 @@ class PendingScope implements Scope return $builder->withoutPending(); } - return $builder->withoutGlobalScope($this); + return $builder->withoutGlobalScope(static::class); }); } @@ -64,7 +64,7 @@ class PendingScope implements Scope protected function addWithoutPending(Builder $builder) { $builder->macro('withoutPending', function (Builder $builder) { - $builder->withoutGlobalScope($this) + $builder->withoutGlobalScope(static::class) ->whereNull($builder->getModel()->getColumnForQuery('pending_since')) ->orWhereNull($builder->getModel()->getDataColumn()); @@ -80,7 +80,7 @@ class PendingScope implements Scope protected function addOnlyPending(Builder $builder) { $builder->macro('onlyPending', function (Builder $builder) { - $builder->withoutGlobalScope($this)->whereNotNull($builder->getModel()->getColumnForQuery('pending_since')); + $builder->withoutGlobalScope(static::class)->whereNotNull($builder->getModel()->getColumnForQuery('pending_since')); return $builder; }); diff --git a/src/Database/ParentModelScope.php b/src/Database/ParentModelScope.php index cfc003c1..c91a23e1 100644 --- a/src/Database/ParentModelScope.php +++ b/src/Database/ParentModelScope.php @@ -22,7 +22,7 @@ class ParentModelScope implements Scope public function extend(Builder $builder): void { $builder->macro('withoutParentModel', function (Builder $builder) { - return $builder->withoutGlobalScope($this); + return $builder->withoutGlobalScope(static::class); }); } } diff --git a/src/Database/TenantScope.php b/src/Database/TenantScope.php index e3b1db69..c3cd6015 100644 --- a/src/Database/TenantScope.php +++ b/src/Database/TenantScope.php @@ -23,7 +23,7 @@ class TenantScope implements Scope public function extend(Builder $builder): void { $builder->macro('withoutTenancy', function (Builder $builder) { - return $builder->withoutGlobalScope($this); + return $builder->withoutGlobalScope(static::class); }); } }