|
1 | 1 | <?php
|
2 | 2 |
|
3 |
| -use Fsylum\RectorWordPress\Rules\FuncCall\ParameterAdderRector; |
4 |
| -use Fsylum\RectorWordPress\Rules\FuncCall\ReturnFirstArgumentRector; |
5 |
| -use Fsylum\RectorWordPress\ValueObject\FunctionParameterAdder; |
6 | 3 | use Rector\Config\RectorConfig;
|
7 | 4 | use Rector\Removing\Rector\FuncCall\RemoveFuncCallArgRector;
|
8 | 5 | use Rector\Removing\Rector\FuncCall\RemoveFuncCallRector;
|
9 | 6 | use Rector\Removing\ValueObject\RemoveFuncCallArg;
|
10 | 7 | use Rector\Renaming\Rector\FuncCall\RenameFunctionRector;
|
11 | 8 |
|
12 | 9 | return static function (RectorConfig $rectorConfig): void {
|
| 10 | + $rectorConfig->import(__DIR__ . '/../config.php'); |
| 11 | + |
13 | 12 | $rectorConfig->ruleWithConfiguration(RemoveFuncCallArgRector::class, [
|
14 | 13 | new RemoveFuncCallArg('get_the_author', 0),
|
15 | 14 | new RemoveFuncCallArg('get_autotoggle', 0),
|
16 | 15 | new RemoveFuncCallArg('wp_get_post_cats', 0),
|
17 | 16 | new RemoveFuncCallArg('wp_set_post_cats', 0),
|
18 | 17 | ]);
|
19 | 18 |
|
20 |
| - $rectorConfig->ruleWithConfiguration(ParameterAdderRector::class, [ |
21 |
| - new FunctionParameterAdder('get_autotoggle', 0, 0), |
22 |
| - ]); |
23 |
| - |
24 | 19 | $rectorConfig->ruleWithConfiguration(RemoveFuncCallRector::class, [
|
25 | 20 | 'links_popup_script',
|
26 | 21 | ]);
|
27 | 22 |
|
28 | 23 | $rectorConfig->ruleWithConfiguration(RenameFunctionRector::class, [
|
| 24 | + 'get_autotoggle' => '__return_zero', |
29 | 25 | 'get_link' => 'get_bookmark',
|
30 | 26 | 'get_settings' => 'get_option',
|
31 | 27 | 'wp_get_post_cats' => 'wp_get_post_categories',
|
32 | 28 | 'wp_set_post_cats' => 'wp_set_post_categories',
|
33 | 29 | ]);
|
34 | 30 |
|
35 |
| - $rectorConfig->ruleWithConfiguration(ReturnFirstArgumentRector::class, [ |
36 |
| - 'get_autotoggle', |
37 |
| - ]); |
38 |
| - |
39 | 31 | /*
|
40 | 32 | * TODO: these are not handled currently
|
41 | 33 | *
|
|
0 commit comments