- Check out a module
- Create feature branch for PHP8.1 refactoring
- Configure Rector
- Run Rector on it
- Commit and PR
- Update Repman (does this happen automatically?)
https://bitbucket.org/elementarydigital/magento2-module-product-label/src/master/
Check out a new feature branch in the module directory:
git checkout -b php81-refactoring HEAD --- Install Rector
- Add it as a
composer require --devdependency to the project (or install it globally)
- Add it as a
- Configure Rector for PHP and Magento 2
- Create a
rector,phpfile in the root of the module directory
- Create a
- Where to find Magento 2 specific rectors?
- Magento coding standard (
magento/magento-coding-standard)
- Magento coding standard (
- Consider configuring Rector for other things e.g. PHPUnit!
php81 /var/www/html/rector/vendor/bin/rector process \
--config /var/www/html/wearemagneto/projects/hstv/html/rector.php \
--autoload-file /var/www/html/wearemagneto/projects/hstv/html/vendor/autoload.php \ /var/www/html/wearemagneto/projects/hstv/html/app/code/Mapp/Connect/Test/Unit/Setup/Patch/Data/DisableForSilverSurfersStoreTest.phpCommit to the feature branch, push and create a new PR in Bitbucket.
Tag in other developers for visibility and to solicit feedback.
Once the PR has been approved, merge to master and tag the commit with an update release version number. Repman will then automatically update the package and make the new version available in composer.
- Build a workflow to automate these steps, possibly using Deployer
Do you mind sharing the
rector.phpfile?