Conversation
|
Do you know what cases this can return It looks like it happens here, but I don't know what the possibilities for Further investigation leads here, which possibly sets it to |
|
Usually, we would remove the false return when it was related to wrong param types. I'd say the cases are the same than function that now throws a TypeError in PHP8 instead of returning false. So if a function still return false in PHP8, I think we should keep the falsable return |
|
You can see it's here for So it should be consistent and be here for formatCurrency. It should allow to use a false check which is valid php code.
As soon as it's possible, the false check should not be reported as an error.
100% agree. Then if someone want to improve the return type, it should be done with a dynamic return type calculation |
|
Thanks! |
Hi @orklah, I just got an error
[TypeDoesNotContainType](https://psalm.dev/056) - 6:9 - string does not contain false.but NumberFormatter::formatCurrency can return false
See https://www.php.net/manual/fr/numberformatter.formatcurrency.php