<commit_before>## 6 Steps to Add New Rector

In case you need a transformation that you didn't find in Dynamic Rectors, you can create your own:

1. Just extend `Rector\Rector\AbstractRector` class. It will prepare **2 methods**:

```php
public function isCandidate(Node $node): bool
{
}

public function refactor(Node $node): ?Node
{
}
```

2. Put it under `namespace Rector\Contrib\<set>;` namespace

```php
<?php declare(strict_types=1);

namespace Rector\Contrib\Symfony;

use Rector\Rector\AbstractRector;

final class MyRector extends AbstractRector
{
    // ...
}
```

3. Add a Test Case

4. Add to specific level, e.g. [`/src/config/level/symfony/symfony33.yml`](/src/config/level/symfony/symfony33.yml)

5. Submit PR

6. :+1:<commit_msg>[README] add link to example test<commit_after>## 6 Steps to Add New Rector

In case you need a transformation that you didn't find in Dynamic Rectors, you can create your own:

1. Just extend `Rector\Rector\AbstractRector` class. It will prepare **2 methods**:

```php
public function isCandidate(Node $node): bool
{
}

public function refactor(Node $node): ?Node
{
}
```

2. Put it under `namespace Rector\Contrib\<set>;` namespace

```php
<?php declare(strict_types=1);

namespace Rector\Contrib\Symfony;

use Rector\Rector\AbstractRector;

final class MyRector extends AbstractRector
{
    // ...
}
```

3. Add a Test Case - [see PHPUnit example](https://github.com/rectorphp/rector/blob/master/tests/Rector/Contrib/PHPUnit/ExceptionAnnotationRector/Test.php)

4. Add to specific level, e.g. [`/src/config/level/symfony/symfony33.yml`](/src/config/level/symfony/symfony33.yml)

5. Submit PR

6. :+1:
{'fraction_non_alphanumeric': 0.1334141904184354, 'fraction_numerical': 0.016979987871437233, 'mean_word_length': 4.339805825242719, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1656014', 'n_tokens_mistral': 589, 'n_tokens_neox': 561, 'n_words': 171}