In November 2019 I stared (*) the https://github.com/rectorphp/rector, as I just learned about how cool Rector was and how it could help me improve and migrate my legacy code.
My star on github, was as first used as a bookmark, but some days later, the team from Rector contacted me, and this change a lot regarding my view on refactoring, complexity and automation tools for development.
What did I win?
I contacted the rector team as instructed in the tweet, and Tomas Votruba got back to me, and we discussed how he could help me.
As I'm most active with the TYPO3 Crawler extension I ask for help to migrate/optimise the current typo3v9-branch, as this is my work in progress branch for the next major release.
Tomas implemented following in our CI pipeline:
- [CI] Add Rector CI
- [Travis] Cleanup and split jobs clearly
- [TASK] Apply static + PSR-12 set
- Apply PHP 7.1 and PHP 7.2 features
All this done within a week, and the code base was already improve a lot.
That's all?
The win wasn't "only" the 4 commits from Tomas, that helped me one time. He help me setup some basics that will help me a lot in the future.
CI
Now we have Rector CI, Code Standard and PHPStan checks as part of our Travis CI Pipeline and this is done for every single commit and pull request, so the quality of the code commit since then will also be improved, cleaner and easier to maintain in the future.
Development
Next time I want to deprecate a PHP Version e.g. PHP 7.2 and PHP 7.3, I can add PHP Sets to the ecs.yaml
and the run the command .Build/bin/ecs check Classes Configuration Tests --fix
and then most, if not all of the changes are done automatically within a few seconds.
The future for me
I don't see how my work as PHP Developer will continue without using a tool like rector, it makes a lot of things way easier.
The rector is in general a tool that can help a lot with PHP and framework updates like symfony, but as I'm more a TYPO3 kind of person, I've joined an initiative to make migration sets for TYPO3 Core Updates as well.
This will ease the upgrade from e.g. TYPO3 9 LTS to TYPO3 10 (Soon to be LTS), but this is something I'll share more about later.
Top comments (0)