From f47e68a23838f6274ca9e9a3e9c6644447c67f50 Mon Sep 17 00:00:00 2001 From: Bert Wijnhoven Date: Wed, 17 Jul 2024 10:09:20 +0200 Subject: [PATCH 1/2] revert model property changes --- src/Traits/Models.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Traits/Models.php b/src/Traits/Models.php index cb8a22f..62d0d93 100644 --- a/src/Traits/Models.php +++ b/src/Traits/Models.php @@ -11,9 +11,9 @@ trait Models { /** - * @var ?class-string<\Illuminate\Contracts\Auth\Authenticatable> + * @var class-string<\Illuminate\Contracts\Auth\Authenticatable> */ - protected ?string $userModelClass = null; + protected string $userModelClass = User::class; /** * @var class-string<\DutchCodingCompany\FilamentSocialite\Models\Contracts\FilamentSocialiteUser> @@ -40,10 +40,7 @@ public function userModelClass(string $value): static */ public function getUserModelClass(): string { - /** @var class-string<\Illuminate\Database\Eloquent\Model&\Illuminate\Contracts\Auth\Authenticatable> */ - $user = User::class; - - return $this->userModelClass ?? $user; + return $this->userModelClass; } /** From e674a00d703debb99d37ce2f4ac8936433b2ec63 Mon Sep 17 00:00:00 2001 From: Bert Wijnhoven Date: Wed, 17 Jul 2024 10:11:12 +0200 Subject: [PATCH 2/2] Revert phpstan baseline --- phpstan-baseline.neon | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 127e7b1..b905152 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -5,6 +5,11 @@ parameters: count: 1 path: src/FilamentSocialitePlugin.php + - + message: "#^Property DutchCodingCompany\\\\FilamentSocialite\\\\FilamentSocialitePlugin\\:\\:\\$userModelClass \\(class\\-string\\\\) does not accept default value of type string\\.$#" + count: 1 + path: src/FilamentSocialitePlugin.php + - message: "#^Parameter \\#1 \\$value of method DutchCodingCompany\\\\FilamentSocialite\\\\Http\\\\Controllers\\\\SocialiteLoginController\\:\\:evaluate\\(\\) expects bool\\|\\(callable\\(\\)\\: bool\\), bool\\|\\(Closure\\(string, Laravel\\\\Socialite\\\\Contracts\\\\User, Illuminate\\\\Contracts\\\\Auth\\\\Authenticatable\\|null\\)\\: bool\\) given\\.$#" count: 1