psalm icon indicating copy to clipboard operation
psalm copied to clipboard

Deduplicate loop analysis

Open theodorejb opened this issue 1 year ago • 4 comments

Also fixed some risky truthy falsy comparisons.

theodorejb avatar Mar 03 '24 18:03 theodorejb

@weirdan Does anything prevent merging this?

theodorejb avatar Mar 15 '24 13:03 theodorejb

@theodorejb I've been meaning to play with it locally, but haven't found the time yet. One thing that caught my eye is the type change for $protected_var_ids - perhaps there's a reason for that, but it's not immediately apparent.

weirdan avatar Mar 20 '24 05:03 weirdan

@weirdan array<string, bool|int> seems to be the correct type for $protected_var_ids, since it's assigned to from a property with the same name in LoopScope, which has that type. The LoopScope property has that type because in one place it's assigned to from an array merge with $assigned_var_ids, which has a type of array<string, int>.

theodorejb avatar Mar 20 '24 16:03 theodorejb