-
-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TypeDeclaration] Handle double declare(strict_types=1) addition on DeclareStrictTypesRector + IncreaseDeclareStrictTypesRector #5928
Conversation
Fixed 🎉 |
These 2 rules should never be run together, as they approach same issue differently. |
Ok, when using |
I am looking for general issue on rector transformation, while both rules should not run together, but the order of stmt should be kept, so it should already skip already. |
This reverts commit 31a6826.
d1f31a5
to
729010f
Compare
I got it, the current patch is by check current nodes as well, as This handle "just added nodes", which the rule maybe different with both, as the rector-src/src/Application/FileProcessor.php Lines 73 to 74 in e03da04
|
The another solution is ensure call: // ensure update new stmts on each rules applied
$this->file->changeNewStmts($nodes); on This will works on general transformation, not only this kind of conflict usage. |
Ok, using It seems we should not use rector-src/src/Application/FileProcessor.php Lines 73 to 74 in e03da04
@TomasVotruba I am going to merge it as it may related with how this rule behaviour cross with other rule that change first level stmts ;) |
While user should choose one of the rules, when it added both, it cause double addition:
which should only one, ref #5926