Use withComposerBased instead of the deprecated SetList#36
Use withComposerBased instead of the deprecated SetList#36zoglo wants to merge 1 commit intocontao:mainfrom
withComposerBased instead of the deprecated SetList#36Conversation
|
I don't think these are correct for our use case. It infers the Symfony version from your installed dependencies, which works for a project. But it you apply this to a bundle, you want to use the minimum version of your requirement, not what Composer installed. |
Good point, this feature however would take the lowest version 🤔. The blogpost does explain it pretty good that using specific sets will lead to your refactored base using the updated level sets instead of checking for the composer version instead, be it Symfony ^7.0 but our sets would most likely force it to upgrade to ^7.4 instead (even though the other minors are discouraged to use). The real benefit comes when using Rector across major versions of Symfony (and kind of minors since ^7.0 will take all level sets right now, forcing your bundle to use 7.4 :) ) |
🤔 But you are right on that. For bundles it will be different. |
|
I think I am gonna test this more with specific versions and requirements first =) |
|
Contao 5.7 will require Symfony ^7.4 when it is released (as far as I know) |
|
I just had to revert already-active |
Description
Seen that new level sets have been introduced in ccc403a but the usage of SetList is discouraged and deprecated.
Since Rector 2 we can use composer based level set lists: https://getrector.com/blog/introducing-composer-version-based-sets
This PR changes it for the latest change right now making sure that the SetList is dependent on the composer.json.
/cc @aschempp this could be introduced in the other level sets in the future if needed. Wdyt?