mirror of
https://github.com/rectorphp/rector.git
synced 2025-04-21 07:52:01 +02:00
3 steps now
This commit is contained in:
parent
e7f420d484
commit
de90fd6d66
@ -165,7 +165,7 @@ Just use `--with-style` option to handle these basic cases:
|
||||
vendor/bin/rector process src --with-style
|
||||
```
|
||||
|
||||
## 4 Steps to Create Own Rector
|
||||
## 3 Steps to Create Own Rector
|
||||
|
||||
First, make sure it's not covered by [any existing Rectors yet](/docs/AllRectorsOverview.md).
|
||||
|
||||
@ -177,12 +177,10 @@ Let's say we want to **change method calls from `set*` to `change*`**.
|
||||
+$user->changePassword('123456');
|
||||
```
|
||||
|
||||
### 1. Create New Rector
|
||||
### 1. Create New Rector and Implement Methods
|
||||
|
||||
Create class that extends [`Rector\Rector\AbstractRector`](/src/Rector/AbstractRector.php). It has useful methods like checking node type and name. Just run `$this->` and let PHPStorm show you all possible methods.
|
||||
|
||||
### 1. Implement Methods from `AbstractRector`
|
||||
|
||||
```php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user