Skip to content

Conversation

@samsonasik
Copy link
Member

constructor is marked as final since phpunit 12.0.3 so I think the rule ParentTestClassConstructorRector itself can be removed.

Ref phpunit diff sebastianbergmann/phpunit@3263f4c

Closes rectorphp/rector#9180

@samsonasik
Copy link
Member Author

@Jean85 this should fix it :)

@samsonasik
Copy link
Member Author

@TomasVotruba ready to merge 👍

@TomasVotruba
Copy link
Member

This rule is for PHPUnit 10 only. It must stay to help with upgrade of PHPUnit 9 to 10. It should not be run on newer PHPUnit

@samsonasik
Copy link
Member Author

so we need another rule for phpunit 12 to drop __construct since it marked as final on phpunit 12?

If yes, I think "other rule" on the list check to be ignored is needed to avoid flip flop add __construct if both rules executed.

@samsonasik
Copy link
Member Author

Ok, I think flag like $node->setAttribute('hasRemovedFinalConstruct', true); can be added on phpunit 12 rule so on phpunit 10 rule can be skipped if has hasRemovedFinalConstruct flag.

@samsonasik
Copy link
Member Author

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ParentTestClassConstructorRector does not consider final constructor

3 participants