-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Model when use Carbon, auto generate docblock not pass by phpstan. #1004
Comments
my php code sample below $this->vip_end = $this->vip_end->addDays($vip_days); |
I wondered if my PR #859 is responsible but I'm not sure because it looks like when I made the PR, there was already no |
How did you end up with I've never seen it generated that way from ide-helper? Even the Or did you simply have another tool reformatting that before you pasted it? 🤔 |
What I mean is: ide-helper never generated the union
So it never was a union |
Hello @mfn, I don't know if I made myself clear. Sorry for my poor english. |
@kylekatarnls phpstsan complains that when a model
Thing is, it seems a mismatch of (php)doc vs. what really happens? From
But the resulting object is
But I see via briannesbitt/Carbon#1914 this was quite deliberate… So it's either "IDE" or "static analyzers" at the moment? |
Maybe the helper should rather generate |
Interesting idea. However I'm not seeing myself pursuing this, as if will cause additional confusion when people see the result is Was my hunch right that?
|
Actually I would like to PHPDoc the Carbon method with some |
A other possible fix is to copy-paste the Maybe I can propose a fix for |
…from Carbon\Carbon
…from Carbon\Carbon
I also could change |
This may related to https://youtrack.jetbrains.com/issue/WI-54071 …
You in fact did, didn't you? => briannesbitt/Carbon@0a41ea7 Because I was about to test this "in code" in an up2date project and I couldn't reproduce it 😅 when I realized
I guess it's fine, because:
The way I see it, with the release nestbot/carbon 2.39.0 everything is solved and we can close this issue and don't need #1014 ? |
Yes it should be 👌 |
Solved it is then 😄 |
I am sorry, but I fail to see how this has been solved. I am still experiencing this exact issue, where the the generated docblocks state |
This is not solved @kylekatarnls @mfn. You can check larastan/larastan#1067. The packages are not compatible right now |
this is my User Model diff after run
php artisan ide-helper:models -WR
it will remove
\Carbon\Carbon
in docblock, would lead to result by phpstan: (https://github.com/nunomaduro/larastan)Is there something I'm doing wrong? Please advise, thank you very much!
The text was updated successfully, but these errors were encountered: