Library PHP Tek 2025 Mastering automated refactoring with custom Rector rules
Mastering automated refactoring with custom Rector rules

Log in to watch this talk

You need to be logged in to access this video. If you don't have an account, purchase a virtual pass for the latest php[tek] conference to get access to the full video library.

Mastering automated refactoring with custom Rector rules

Dave Liddament Dave Liddament PHP Tek 2025 Advanced Tutorial (3 hours)

Are you working on a legacy project that is in need of upgrading? Do you need to make changes to your project that require the same repetitive refactor applied to your codebase hundreds of times and no existing tools can to help automate the task? If either of these scenarios are familiar you've probably had a look at or used Rector. Rector has hundreds of rules that help with automating upgrades and refactors. However what happens if you need to do something custom to your project, that is not available with an existing Rector Rule? In this case you can create your own custom Rector rule. This tutorial will teach you how to create custom Rector rules that can automate tasks specific to your project. By the end of this tutorial you'll know how to create your own rules and have a framework for creating rules for whatever refactor you wish to automate.