-
Notifications
You must be signed in to change notification settings - Fork 696
Closed
Labels
Description
I'm currently implementing AfterExpressionAnalysisInterface in order to detect and change == into === when safe.
It seemed pretty easy but I'm stuck with an issue I don't know how to solve.
In SwitchCaseAnalyzer (and probably elsewhere), Psalm is creating a new Expr\BinaryOp\Equal in order to analyse operations. This Equal Expression is then sent to the plugin as if it was in the original code as a real "==" node.
Unfortunately, When I try to replace with a === it just breaks the code. I couldn't find a way to differentiate between those virtual nodes and real one.
Is there a way to do that I'm missing or could we maybe flag those node somehow to exclude them in plugin analysis?
Reactions are currently unavailable