-
-
Notifications
You must be signed in to change notification settings - Fork 402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic call to static method configurationIsCached() / routesAreCached(). #483
Comments
Hi, Thanks for reporting this. Do you have any other PHPStan extension installed? Like strict rules. Do you any annotation for the |
Yes, we have strict rules enabled.
We don't have any annotations. This is the class that trigger the warning https://laravel.com/api/7.x/Illuminate/Foundation/Application.html Here are the functions in the framework repository. https://github.com/laravel/framework/blob/7.x/src/Illuminate/Foundation/Application.php#L945 |
#355 might be related also. I'll try to investigate later this week. |
Just to confirm... is this related to v7? I don't remember getting those in v6 I don't really know how those checks are made, but maybe it's the class definition conflicting with the Facade definition? In Facade it's declared as static, and interface/class it's a class method. |
Yes, this warnings popped when I upgraded to laravel v7, see the issue description. |
Just opened a ticket here laravel/framework#32079 |
This is not a bug in Laravel itself. It is about Larastan. And when strict rules used together with Larastan it causes this issue. I still didn't quite figure it out yet, but I'll spend more time on it. |
This is also happening for public function action(Request $request) {
$request->validate([ ... ]); // Dynamic call to static method Illuminate\Http\Request::validate().
} |
I was not able to produce this issue with a fresh laravel installation + that code + Larastan. |
--level
used: 8Description
We just upgraded to laravel v7, and these 2 warnings pops out.
You can see the PR here https://github.com/directus/api-next/pull/148
I read the code and both methods are not static.
I might be missing something huge. Not sure.
Laravel code where the issue was found
See more at https://github.com/directus/api-next/blob/master/src/Laravel/Providers/DirectusProvider.php
The text was updated successfully, but these errors were encountered: