Automatically upgrade your PHP code from 5.3 to PHP 7.4 with Rector
Rector is a reconstructor tool – it does instant upgrades and instant refactoring of your code. Why refactor manually if Rector can handle 80% for you?
Installation per Composer:
composer require rector/rector --dev
For example, to upgrade the contents of the
vendor/bin/rector process src --set php74
The cool thing is that Rector uses sets, of which it has many. Upgrading from SwiftMailer 5 to 6 or from Twig 1 to Twig 2.4.0 for example? There are sets available for those.
Configuration through a
rector.yaml is also possible.