|
23 | 23 | use Guanguans\RectorRules\Rector\Name\RenameToPsrNameRector; |
24 | 24 | use Guanguans\RectorRules\Rector\New_\NewExceptionToNewAnonymousExtendsExceptionImplementsRector; |
25 | 25 | use Illuminate\Support\Str; |
26 | | -use PhpParser\Node\Expr\ClassConstFetch; |
27 | | -use PhpParser\Node\Identifier; |
28 | | -use PhpParser\Node\Name\FullyQualified; |
29 | | -use PhpParser\Node\Scalar\String_; |
30 | 26 | use PhpParser\NodeVisitor\ParentConnectingVisitor; |
31 | 27 | use Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector; |
32 | 28 | use Rector\CodeQuality\Rector\LogicalAnd\LogicalToBooleanRector; |
|
48 | 44 | use Rector\EarlyReturn\Rector\Return_\ReturnBinaryOrToEarlyReturnRector; |
49 | 45 | use Rector\Naming\Rector\ClassMethod\RenameParamToMatchTypeRector; |
50 | 46 | use Rector\Naming\Rector\ClassMethod\RenameVariableToMatchNewTypeRector; |
51 | | -use Rector\NodeTypeResolver\Node\AttributeKey; |
52 | 47 | use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector; |
53 | 48 | use Rector\PHPUnit\Set\PHPUnitSetList; |
54 | 49 | use Rector\Renaming\Rector\FuncCall\RenameFunctionRector; |
55 | 50 | use Rector\Set\ValueObject\DowngradeLevelSetList; |
56 | 51 | use Rector\Set\ValueObject\SetList; |
57 | 52 | use Rector\Transform\Rector\FuncCall\FuncCallToStaticCallRector; |
58 | | -use Rector\Transform\Rector\Scalar\ScalarValueToConstFetchRector; |
59 | 53 | use Rector\Transform\Rector\StaticCall\StaticCallToFuncCallRector; |
60 | 54 | use Rector\Transform\ValueObject\FuncCallToStaticCall; |
61 | | -use Rector\Transform\ValueObject\ScalarValueToConstFetch; |
62 | 55 | use Rector\Transform\ValueObject\StaticCallToFuncCall; |
63 | 56 | use Rector\ValueObject\PhpVersion; |
64 | 57 | use Rector\ValueObject\Visibility; |
|
164 | 157 | 'phpstan-ignore-next-line', |
165 | 158 | 'psalm-suppress', |
166 | 159 | ]) |
167 | | - ->withConfiguredRule( |
168 | | - ScalarValueToConstFetchRector::class, |
169 | | - collect((new ReflectionClass(AttributeKey::class))->getConstants()) |
170 | | - ->map(static fn (string $value, string $name): ScalarValueToConstFetch => new ScalarValueToConstFetch( |
171 | | - new String_($value), |
172 | | - new ClassConstFetch(new FullyQualified(AttributeKey::class), new Identifier($name)) |
173 | | - )) |
174 | | - ->all() |
175 | | - ) |
176 | 160 | ->withConfiguredRule(StaticCallToFuncCallRector::class, [ |
177 | 161 | // new StaticCallToFuncCall(Str::class, 'of', 'str'), |
178 | 162 | ]) |
|
0 commit comments