lint/control-flow/no-for-init-overwrite
In the lint-essential preset and every stricter one. Report only. Intent: suspicious. Upstream setting: strictRules.overwriteVariablesWithLoop.
What it does
Disallows a for loop’s init expression overwriting a variable that is already defined.
Configuration
[lint.rules]
"control-flow/no-for-init-overwrite" = "error"
To skip it in some files or lines, add an override or an ignore comment.
Replaces
OverwriteVariablesWithForLoopInitRule(phpstan-classes)for.variableOverwrite(phpstan-strict-rules)