Creating a new Rector rule means many small steps. You need to create rule file, test file, test fixtures, put it into right category, bla bla bla...
How can we remove repeated work and let us focus only on refactor()
method?
It creates a bare structured Rule. Don't worry, also generates a test case, which is required to contribute.
-
Copy
rector-recipe.php.dist
torector-recipe.php
-
Change parameters in
rector-recipe.php
to meet you need -
Run command
vendor/bin/rector generate
That's it :)