Open nmeri17 opened 1 year ago
Hey @nmeri17, can you reproduce the issue on https://psalm.dev ?
Can anyone help with this, please? Cc @orklah @muglug
For you first issue, check https://psalm.dev/docs/manipulating_code/fixing/#safety-features, I think your answer will be here.
For you second issue, there is no config for that. Your function returns a type that is more specific that what you documented, it's Psalm's job to add the most precise type in docblock
I didn't want to spam issues but was asked to create a new ticket on this comment . I've also checked the psalm.xml docs and can't find settings for this.
I have a class where a property is updated to a reference type somewhere within the code. I expect Psalm to type the property to that reference type, like so:
Instead, I get,
This works fine for scalar types and OCCASSIONALLY for reference types (I can see some properties set to
object
instead of their real types). My composer.json is set to 8.1, but I still set it on the CLI just to be on the safe side. It still does the same thing. I'm not sure this can be tested with one class since the types are imported from other libraries. You can clone the project and attempt psalm on this file https://github.com/nmeri17/suphle/blob/dbeeaa7e639863b587dbd40d7d308325e2958f02/src/Adapters/Orms/Eloquent/OrmBridge.php. You should get this:Another related issue is that typed methods don't need additional docblocks. Maybe it's just me. I'll prefer to turn it off if such setting exists. I have this method that should be skipped:
But then, it produces this: