Replies: 1 comment
-
Hi, Yeah this is a known issue. And currently it is not even possible to fix it. PHPStan does not have an extension point that can influence the type in the closure. So it is a PHPStan limitation. I vaguely remember there was a feature request about this in PHPStan repo. So please search there. If there is not you can create a feature request there. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey all, greetings!
I'm starting to use Larastan, so I'm still getting used to how it works.
For this specific question, this is the problem I'm seeing:
I have the following scope defined in my model:
Larastan returns a problem there, with the following message:
I understand the message, but it's not possible that the type would be
Spatie\LaravelData\Optional
since I'm checking exactly that with thewhen
method.Looks like Larastan is completely ignoring the when condition.
Am I doing something incorrect here?
Beta Was this translation helpful? Give feedback.
All reactions