mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-04 18:30:50 +00:00
f672eace0e
* [DX] Add init-recipe command to initlaize recipe * update docs
704 B
704 B
Generate a new Rector Rule
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?
What generate
Command is Does?
It creates a bare structured Rule. Don't worry, also generates a test case, which is required to contribute.
How to Generate Rector rule in 3 steps?
-
Initialize
rector-recipe.php
configvendor/bin/rector init-recipe
-
Complete parameters in
rector-recipe.php
to design your new rule -
Run command
vendor/bin/rector generate
That's it :)