New Rules ✨
- Add
TernaryToNullsafeCoalesceRector(#8499) - Add
BoolReturnTypeFromBooleanConstAndStrictReturnsRectorfor mixed const + strict bool returns (#8498) - Add
ConstructorReadonlyAssignToDefaultRectorfor readonly property defaults (#8502) - Add
RemoveOverriddenAssignBeforeIfElseRector(#8505)
Performance Improvements 🚀
- Cache class-like name resolution per file version in
ShortNameResolver, so name import no longer rescans the whole file for every name - up to ~24 % fewer CPU instructions on large projects (#8524) - Cache dry-run files whose
FileDiffhas no content change (#8523) - Key the file cache on project-relative paths, so a cache survives a change of checkout (#8490)
- Use
FileSystem::writeAtomic()inFileCacheStorageto avoid partial cache reads on parallel runs (#8520) - Terminate timed-out and unconnected workers (#8522)
- Fix silently skipped files when the only worker is respawned (#8521)
- Give the worker the same NDJSON frame limit as the main process (#8489)
- Bump to PHPStan 2.3
Bugfixes 🐛
RenamePropertyRector: rename the property both in the trait and in the class property itself (#8518)RenameClassRector: throw on same old and new class in the configuration (#8515)ScalarParamTypeByMethodCallTypeRector: skip string param inference to avoid unsafe scalar coercion (#8514)RepeatedAndNotEqualToNotInArrayRector/RepeatedOrEqualToInArrayRector: skip short-circuit dependent values (#8516)SeparateMultiUseImportsRector: keep traituseadaptations (#8510)Privatize*Rector: drop thefinalflag when changingprotectedtoprivate, sinceprivate finalis forbidden on PHP 8.4 (#8509)AddNameToBooleanArgumentRector/AddNameToNullArgumentRector: skip callees marked@no-named-arguments(#8508)TypedPropertyFromStrictConstructorRector: skip a protected property redeclared in a child class (#8503)RemoveAlwaysTrueIfConditionRector: skip a maybe-undefined variable (#8501)SingularSwitchToIfRector: skip nestedbreak/continuein the case body (#8500)TypeDeclaration: skip redundant intersection types in union return types (#8527)- Naming: keep mass nouns ending in
data/infountouched when singularizing (#8492)
rector-doctrine 🟠
- Add
DoctrineQueryBuilderSortDirectionRector(#524) - Add
DoctrineOrderByAttributeSortDirectionRector(#525) - Register the SortDirection rules in the composer-based set and cover
Expr\OrderBy::add()(#530) CorrectDefaultTypesOnEntityPropertyRector: support properties initialized asint(#526)
rector-symfony 🎵
GetRequestRector: reuse an existing untyped$requestparam (#1066)CommandConfigureToAttributeRector: do not report a change when nothing is extracted (#1068)- Fix
PhpAstExtractorimport removal in the composer-based Symfony set (#1070)
rector-phpunit 🟢
- Add
WillReturnCallbackFallbackToReturnFalseRector(#784) - Extend
FlipAssertRectorto more assert methods and expected value shapes (#787) AllowMockObjectsForDataProviderRector: skip stub-only->method()calls (#790)- Fix changing keys of data providers for tests with optional arguments (#783)
- Deprecate
ConfiguredMockEntityToSetterObjectRectoras experimental (#789)