|
1 | 1 | <?php |
2 | 2 |
|
| 3 | +use PhpParser\Node\Expr\Cast\Bool_; |
| 4 | +use PhpParser\Node\Expr\Cast\Double; |
| 5 | +use PhpParser\Node\Expr\Cast\Int_; |
3 | 6 | use Rector\Config\RectorConfig; |
4 | 7 | use Rector\DeadCode\Rector\ClassLike\RemoveAnnotationRector; |
5 | 8 | use Rector\Php70\Rector\StmtsAwareInterface\IfIssetToCoalescingRector; |
6 | 9 | use Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector; |
7 | 10 | use Rector\Php80\Rector\Switch_\ChangeSwitchToMatchRector; |
| 11 | +use Rector\Renaming\Rector\Cast\RenameCastRector; |
| 12 | +use Rector\Renaming\ValueObject\RenameCast; |
8 | 13 |
|
9 | 14 | return RectorConfig::configure() |
10 | 15 | ->withPaths([ |
|
20 | 25 | ]) |
21 | 26 | // All classes are public API by default, unless marked with @internal. |
22 | 27 | ->withConfiguredRule(RemoveAnnotationRector::class, ['api']) |
| 28 | + // Fix PHP 8.5 deprecations |
| 29 | + ->withConfiguredRule( |
| 30 | + RenameCastRector::class, |
| 31 | + [ |
| 32 | + new RenameCast(Int_::class, Int_::KIND_INTEGER, Int_::KIND_INT), |
| 33 | + new RenameCast(Bool_::class, Bool_::KIND_BOOLEAN, Bool_::KIND_BOOL), |
| 34 | + new RenameCast(Double::class, Double::KIND_DOUBLE, Double::KIND_FLOAT), |
| 35 | + ], |
| 36 | + ) |
23 | 37 | // phpcs:disable Squiz.Arrays.ArrayDeclaration.KeySpecified |
24 | 38 | ->withSkip([ |
25 | 39 | RemoveExtraParametersRector::class, |
|
0 commit comments