Rector is a powerful tool that can help improve your PHP projects' code quality by establishing a standard of robust programming practices. It can also be used to migrate legacy projects from PHP 5.3 to PHP 8.4 safely and is a perfect addition to your CI process to continuously refactor your code and keep the code quality high.
Rector v2 is now out and while the release focussed on performance improvements (about 10-15% faster), the team behind the project managed to add a few new features as well.
In this release, the following features were added:
- The
--only
Option to run one (1) Rule - The introduction of Composer-based sets
- Polyfill Packages by Default
- Smarter Annotations to Attributes sets
- Leaner Custom Rules
The upgrade from previous versions should be straightforward, but for custom rules writers, you should look at the upgrade guide.
To learn more about the new features in this release, have a look at their release blog post and to view the documentation and the source code, check out the Github repository.