Skip to content

[DX] Remove AddDefaultValueForUndefinedVariableRector as can generate broken code and depends on context#4729

Merged
TomasVotruba merged 2 commits intomainfrom
tv-undefined-variable-default
Aug 9, 2023
Merged

[DX] Remove AddDefaultValueForUndefinedVariableRector as can generate broken code and depends on context#4729
TomasVotruba merged 2 commits intomainfrom
tv-undefined-variable-default

Conversation

@TomasVotruba
Copy link
Copy Markdown
Member

@TomasVotruba TomasVotruba commented Aug 9, 2023

This rule can cause errors in case of added/new/removed variables, as it can think that just removed variable should be added :)
It can cause crashes like these: #4702 (comment)

There was ❗ 9 extra test that colided with other rules just to be sure it doesn't colide with each other. Still not good enough.

Also missing variable raises a warning, so not really deprecation: https://3v4l.org/nMR15

Better let PHPStan report it and fix propperly 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant