vimeo / psalm

A static analysis tool for finding errors in PHP applications
https://psalm.dev
MIT License
5.54k stars 659 forks source link

Override DateTime::diff() causes unsolvable error #11039

Open jasverix opened 2 months ago

jasverix commented 2 months ago

https://psalm.dev/r/27962b249b

If I change to $datetime2, it also becomes wrong, and it is wrong, because the name is $targetObject.

psalm-github-bot[bot] commented 2 months ago

I found these snippets:

https://psalm.dev/r/27962b249b ```php
jasverix commented 2 months ago

Also note that it do not react on targetObject: in parent::diff().