orklah
orklah
Hi @tm1000 Can you try to make sense of this? :)
It comes from here: https://github.com/vimeo/psalm/blob/1c19260cddea29803cba2ef31c3a49189bcdeb0c/src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/CoalesceAnalyzer.php#L46 When processing a coalesce operator, Psalm will create a fake expression that looks like this: `isset($XXX) ? $XXX : [];` the `$XXX` must be absolutely...
CoalesceAnalyzer is in need of a lot of love! We have multiple bugs related to the logic in here and the fact that we transform the coalesce into a fake...
Can you post your config file, your baseline if you have one as well as the entire Psalm output?
Here's the place where it would need to be done: https://github.com/vimeo/psalm/blob/5d976900d1c593e36976f436a59159b31fa234ef/src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php#L1006 However, I'm not sure it would be worth it. For reference, here's how mutliplication is handled: https://github.com/vimeo/psalm/blob/5d976900d1c593e36976f436a59159b31fa234ef/src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php#L1100-L1274 174 lines...
> $a | $b => max(rangeof($a), rangeof($b)) That seems wrong https://3v4l.org/tkSVn 64|63 gives 127 so the final result may be higher than each of the operands I think the best...
I'm bad at maths but this seems feasible. Would that have any practical use though? Except some fringe apps, when do you ever have to do that kind of operations...
I don't think considering `array` as outputting `(non-numeric-string|int)` would be so great. Firstly, it's inexact: https://3v4l.org/pcYP0 so, real type becomes `(non-numeric-string|numeric-string|int)` which would collapse into `(string|int)` which is basically saying...
Not perfectly sure what you mean by that, but the host for shepherd can actually be changed: https://github.com/vimeo/psalm/blob/68d88c546b286a5fbdabe4728f6be9dd1db0dbe0/src/Psalm/Config.php#L541 through options or env variables: https://github.com/vimeo/psalm/blob/386aa27f4c0d54919528145833e7d460ec4dac84/src/Psalm/Internal/Cli/Psalm.php#L304 Aside from that, Shepherd is just...