diff --git a/config/set/php74.php b/config/set/php74.php index 0cbfe7404dc..5094749e76f 100644 --- a/config/set/php74.php +++ b/config/set/php74.php @@ -2,11 +2,11 @@ declare(strict_types=1); +use PhpParser\Node\Expr\Cast\Double; use Rector\Config\RectorConfig; use Rector\Php74\Rector\ArrayDimFetch\CurlyToSquareBracketArrayStringRector; use Rector\Php74\Rector\Assign\NullCoalescingOperatorRector; use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector; -use Rector\Php74\Rector\Double\RealToFloatTypeCastRector; use Rector\Php74\Rector\FuncCall\ArrayKeyExistsOnPropertyRector; use Rector\Php74\Rector\FuncCall\FilterVarToAddSlashesRector; use Rector\Php74\Rector\FuncCall\HebrevcToNl2brHebrevRector; @@ -16,7 +16,9 @@ use Rector\Php74\Rector\Property\RestoreDefaultNullToNullableTypePropertyRector; use Rector\Php74\Rector\StaticCall\ExportToReflectionFunctionRector; use Rector\Php74\Rector\Ternary\ParenthesizeNestedTernaryRector; +use Rector\Renaming\Rector\Cast\RenameCastRector; use Rector\Renaming\Rector\FuncCall\RenameFunctionRector; +use Rector\Renaming\ValueObject\RenameCast; return static function (RectorConfig $rectorConfig): void { $rectorConfig @@ -31,7 +33,6 @@ FilterVarToAddSlashesRector::class, ExportToReflectionFunctionRector::class, MbStrrposEncodingArgumentPositionRector::class, - RealToFloatTypeCastRector::class, NullCoalescingOperatorRector::class, ClosureToArrowFunctionRector::class, RestoreDefaultNullToNullableTypePropertyRector::class, @@ -41,4 +42,9 @@ RestoreIncludePathToIniRestoreRector::class, HebrevcToNl2brHebrevRector::class, ]); + + $rectorConfig->ruleWithConfiguration( + RenameCastRector::class, + [new RenameCast(Double::class, Double::KIND_REAL, Double::KIND_FLOAT)] + ); }; diff --git a/phpstan.neon b/phpstan.neon index beb68cd801a..39ec473537f 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -332,3 +332,9 @@ parameters: - identifier: arrayValues.list path: rules/CodingStyle/Application/UseImportsAdder.php + + - + message: '#^Register "Rector\\Php74\\Rector\\Double\\RealToFloatTypeCastRector" service to "php74\.php" config set$#' + identifier: rector.upgradeDowngradeRegisteredInSet + count: 1 + path: rules/Php74/Rector/Double/RealToFloatTypeCastRector.php