File tree Expand file tree Collapse file tree 5 files changed +48
-0
lines changed
Expand file tree Collapse file tree 5 files changed +48
-0
lines changed Original file line number Diff line number Diff line change 2020 $ rectorConfig ->import (__DIR__ .'/../config.php ' );
2121 $ rectorConfig ->sets ([
2222 SetList::COMMON ,
23+ SetList::PEST ,
2324 SetList::PHPBENCH ,
2425 SetList::PHPSTAN ,
2526 SetList::RECTOR ,
Original file line number Diff line number Diff line change 2020use Guanguans \RectorRules \Rector \FunctionLike \RenameGarbageParamNameRector ;
2121use Guanguans \RectorRules \Rector \Namespace_ \RemoveNamespaceRector ;
2222use Rector \Config \RectorConfig ;
23+ use Rector \Php82 \Rector \Param \AddSensitiveParameterAttributeRector ;
2324
2425return static function (RectorConfig $ rectorConfig ): void {
2526 $ rectorConfig ->import (__DIR__ .'/../config.php ' );
3132 SortFileFunctionStmtRector::class,
3233 // SortListItemOfSameScalarTypeRector::class,
3334 ]);
35+
36+ $ rectorConfig ->ruleWithConfiguration (AddSensitiveParameterAttributeRector::class, [
37+ AddSensitiveParameterAttributeRector::SENSITIVE_PARAMETERS => [
38+ 'accessToken ' ,
39+ 'apiKey ' ,
40+ 'botApiKey ' ,
41+ 'key ' ,
42+ 'password ' ,
43+ 'pushKey ' ,
44+ 'secret ' ,
45+ 'tempKey ' ,
46+ 'token ' ,
47+ 'webHook ' ,
48+ ],
49+ ]);
3450};
Original file line number Diff line number Diff line change 1616use Carbon \Carbon ;
1717use Illuminate \Support \Carbon as IlluminateCarbon ;
1818use Rector \Config \RectorConfig ;
19+ use Rector \Renaming \Rector \FuncCall \RenameFunctionRector ;
1920use Rector \Renaming \Rector \Name \RenameClassRector ;
2021
2122return static function (RectorConfig $ rectorConfig ): void {
2223 $ rectorConfig ->import (__DIR__ .'/../../config.php ' );
2324 $ rectorConfig ->ruleWithConfiguration (RenameClassRector::class, [
2425 Carbon::class => IlluminateCarbon::class,
2526 ]);
27+ $ rectorConfig ->ruleWithConfiguration (RenameFunctionRector::class, [
28+ 'faker ' => 'fake ' ,
29+ 'Pest\Faker\fake ' => 'fake ' ,
30+ 'Pest\Faker\faker ' => 'fake ' ,
31+ ]);
2632};
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ /** @noinspection PhpInternalEntityUsedInspection */
4+
5+ declare (strict_types=1 );
6+
7+ /**
8+ * Copyright (c) 2025-2026 guanguans<ityaozm@gmail.com>
9+ *
10+ * For the full copyright and license information, please view
11+ * the LICENSE file that was distributed with this source code.
12+ *
13+ * @see https://github.com/guanguans/rector-rules
14+ */
15+
16+ use Rector \Config \RectorConfig ;
17+ use Rector \Renaming \Rector \FuncCall \RenameFunctionRector ;
18+
19+ return static function (RectorConfig $ rectorConfig ): void {
20+ $ rectorConfig ->import (__DIR__ .'/../config.php ' );
21+ $ rectorConfig ->ruleWithConfiguration (RenameFunctionRector::class, [
22+ 'test ' => 'it ' ,
23+ ]);
24+ };
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ final class SetList
2323 public const LARAVEL_80 = __DIR__ .'/../../config/set/laravel/laravel-80.php ' ;
2424 public const LARAVEL_90 = __DIR__ .'/../../config/set/laravel/laravel-90.php ' ;
2525 public const LARAVEL_COMMON = __DIR__ .'/../../config/set/laravel/laravel-common.php ' ;
26+ public const PEST = __DIR__ .'/../../config/set/pest.php ' ;
2627 public const PHPBENCH = __DIR__ .'/../../config/set/phpbench.php ' ;
2728 public const PHPSTAN = __DIR__ .'/../../config/set/phpstan.php ' ;
2829 public const RECTOR = __DIR__ .'/../../config/set/rector.php ' ;
You can’t perform that action at this time.
0 commit comments