Download Latest Version Released Rector 2.1.4 source code.tar.gz (1.9 MB)
Email in envelope

Get an email when there's a new version of Rector

Home / 2.1.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2025-06-24 8.3 kB
Released Rector 2.1 source code.tar.gz 2025-06-24 1.8 MB
Released Rector 2.1 source code.zip 2025-06-24 4.0 MB
Totals: 3 Items   5.8 MB 0

This release comes with new PHP 8.4 rules and 2 new config options, that make rules more powerful :muscle:


New Features :partying_face:

  • [PHP 8.4] Implement array_find_key upgrade (#7008), Thanks @xHeaven!
  • [PHP 8.4] Implement array_find upgrade (#7009), Thanks @xHeaven!
  • [PHP 8.4] Implement array_all upgrade (#7011), Thanks @xHeaven!
  • [PHP 8.4] Implement array_any upgrade (#7010), Thanks @xHeaven!
  • [code-quality] add TernaryImplodeToImplodeRector (#6994)

In this release we also add 2 DX features to streamline upgrades:

  • [DX] Add ->withTreatClassesAsFinal() on so can be used in typed rules (#6974)
    • this extends more conservative rules to apply on classes that are not final
  • [experimental] Add --kaizen option to apply only first X rules at a time (#6876)
  • this option will apply first X rules; especially great to make upgrade steps small, but relevant - check the PR for more


Bugfixes :bug:

  • [Php80] Skip non-abstract method trait on AddParamBasedOnParentClassMethodRector (#6992)
  • [Php81] Skip has JMS attribute on ReadOnlyPropertyRector (#6979)
  • [TypeDeclaration] Move JMS class string definition constant to ClassName value object (#6980)
  • [PhpAttribute] Ensure count($attributeGroups) before loop to avoid repetitive annotation product only single AttributeGroup (#6985)
  • [code-quality] use direct instanceof instead of dummy null, if nullable object type is known (#6987)
  • Fix object type in TypedPropertyFromJMSSerializerAttributeTypeRector (#6989)
  • ExplicitReturnNullRector: skip on goto (#6988), Thanks @staabm!
  • fix invalid string property type without default in PropertyTypeFromStrictSetterGetterRector (#6993)
  • [CodeQuality] Skip first class callable on TernaryImplodeToImplodeRector (#6997)
  • Fix: Array Duplicated Key which is dynamic (#6999), Thanks @peterfox!
  • [Php83] Ensure class->isAbstract() on FeatureFlags::treatClassesAsFinal() check (#7003)
  • [TypeDeclaration] Handle crash on generic iterable on TypedPropertyFromJMSSerializerAttributeTypeRector (#7004)
  • [TypeDeclaration] Use common has < string for detect iterable types (#7005)
  • Covers scenario where func_get_args used in constructor (#7006), Thanks @peterfox!
  • [DeadCode] Move Param used via variadic functions to ParamAnalyzer (#7016)
  • [DeadCode] Skip used by unpack and named argument on RemoveUnusedPrivateMethodParameterRector (#6976)
  • [DeadCode] Handle multiple default on RemoveArgumentFromDefaultParentCallRector (#6978)
  • [DeadCode] Skip abstract method on RemoveUnusedPublicMethodParameterRector (#7002)
  • [DeadCode] Allow named argument removal if argument position is equal with parameter position equal name on RemoveUnusedPrivateMethodParameterRector (#6977)
  • [Php80] Skip used in finally on RemoveUnusedVariableInCatchRector (#6982)
  • [DeadCode] Allow remove normal param that mix with property promotion on RemoveUnusedConstructorParamRector (#7017)


rectorphp/rector-symfony :musical_note:

  • fix to type arg name (#800)
  • [jms] Add AccessorAnnotationToAttributeRector (#799)
  • [jms] Add custom AccessTypeAnnotationToAttributeRector to handle annotation flip to attribute correctly (#798)


rectorphp/rector-doctrine :orange_circle:

  • [typed-collections] Add RemoveNullFromInstantiatedArrayCollectionPropertyRector (#452)
  • skip behats (#451)
  • skip RemoveIfInstanceofCollectionRector in tests (#450)
  • add generic union support (#448)
  • add param / return test fixture (#447)
  • add docblock support to NarrowArrayCollectionToCollectionRector (#446)
  • initialize default array even for non-entity-property collections (#445)
  • remover default null (#444)
  • add local call setter support (#443)
  • Add intersection support to NarrowPropertyUnionToCollectionRector (#442)
  • remove nullable property type (#441)
  • Add native return type declaration support to NarrowReturnUnionToCollectionRector (#440)
  • add array-filter to ArrayMapOnCollectionToArrayRector (#439)
  • [typed-collections] Add CurrentOnCollectionToArrayRector (#438)
  • [typed-collections] Add RemoveUselessIsEmptyAssignRector (#437)
  • add boolean and not null case (#436)
  • skip it (#435)
  • [typed-collections] Add RemoveIfCollectionIdenticalToNullRector (#434)
  • add native property type support to NarrowPropertyUnionToCollectionRector (#433)
  • add union null type support to RemoveNullFromNullableCollectionTypeRector (#431)
  • add nullable property doclbock support to RemoveNullFromNullableCollectionTypeRector (#430)
  • [typed-collections] Add ArrayOffsetSetToSetCollectionCallRector (#429)
  • include message as well (#428)
  • add static call support to AssertSameCountOnCollectionToAssertCountRector (#427)
  • keep args in RemoveNullsafeOnCollectionRector (#426)
  • [typed-collections] Add AssertSameCountOnCollectionToAssertCountRector (#425)
  • [typed-collections] Add RemoveAssertNotNullOnCollectionRector (#424)
  • [typed-collections] Add AssertNullOnCollectionToAssertEmptyRector (#423)
Source: README.md, updated 2025-06-24