Skip to content
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

Please add support for Rector 2.x #493

Open
fooman opened this issue Mar 13, 2025 · 2 comments · May be fixed by #494
Open

Please add support for Rector 2.x #493

fooman opened this issue Mar 13, 2025 · 2 comments · May be fixed by #494

Comments

@fooman
Copy link

fooman commented Mar 13, 2025

Since the magento-coding-standard uses Rector 1.x which in turn requires Phpstan 1.x it is currently not possible to use the latest versions of those tools in conjunction with this package. See also latest versions of bitExpert/phpstan-magento.

I have had a look at the upgrade instructions and extending the range of supported rector versions should be possible without code changes, ie incomposer.json change

"rector/rector": "^1.2.4",

to

"rector/rector": "^1.2.4 || ^2.0.0",

AbstractScopeAwareRector is not used
https://github.com/search?q=repo%3Amagento%2Fmagento-coding-standard%20AbstractScopeAwareRector&type=code

getRuleDefinition usage becomes optional
https://github.com/search?q=repo%3Amagento%2Fmagento-coding-standard%20getRuleDefinition&type=code

Copy link

m2-assistant bot commented Mar 13, 2025

Hi @fooman. Thank you for your report.
To speed up processing of this issue, make sure that you provided sufficient information.
Add a comment to assign the issue: @magento I am working on this


Join Magento Community Engineering Slack and ask your questions in #github channel.

@fooman fooman linked a pull request Mar 13, 2025 that will close this issue
@hostep
Copy link
Contributor

hostep commented Mar 13, 2025

If you want a quick fix, you can separate your dev dependencies in composer using something like https://github.com/bamarni/composer-bin-plugin, it allows you to create a new namespace for each individual dev tool (phpstan, php-cs-fixer, phpcs, rector, ...) without having conflicting dependencies getting in the way.

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 a pull request may close this issue.

2 participants