PHPStan error #163
Unanswered
tigerbook73
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I tried to use the code from the Quick Start in my controller and got many phpstan errors.
phpstan errors example :
Line app/Http/Controllers/AuthController.php
61 Result of method Illuminate\Contracts\Auth\StatefulGuard::login() (void) is used.
63 Call to an undefined method Illuminate\Contracts\Auth\StatefulGuard::factory().
76 Call to an undefined method Illuminate\Contracts\Auth\StatefulGuard::tokenById().
114 Call to an undefined method Illuminate\Contracts\Auth\StatefulGuard::refresh().
129 Call to an undefined method Illuminate\Contracts\Auth\StatefulGuard::factory().
examle code:
public function refresh()
{
return $this->respondWithToken(auth('api')->refresh()); // refresh() not defined
}
It seems that jwt-auth adds additional functions to Guard and also modifies the definitions of some functions like attempt().
Besides the Phpstan ignoring, are there any good ways to remove these errors?
BTW, I have also experienced errors in VSCode.
Beta Was this translation helpful? Give feedback.
All reactions