github rectorphp/rector 0.17.11
Released Rector 0.17.11

latest releases: 1.2.10, 1.2.9, 1.2.8...
15 months ago

New Features and Improvements 🥳

  • [TypeDeclaration] Add nullable param from null compare on StrictStringParamConcatRector (#4636)
  • [TypeDeclaration] Add ReturnUnionTypeRector (#4655)
  • [TypeDeclaration] Skip public method on AddMethodCallBasedStrictParamTypeRector (#4659)
  • [CodeQuality][TypeDeclaration] Add string append support on ReturnTypeFromStrictScalarReturnExprRector (#4657)
  • [TypeDeclaration] Handle anonymous class in union on AddArrowFunctionReturnTypeRector (#4676)
  • [Types] Make AddVoidReturnTypeWhereNoReturnRector work only with type-declaration, as reliable (#4720)
  • [TypeDeclaration] Allow change multiple methods on AddParamTypeDeclarationRector (#4727)
  • [DX] Add ProcessConfigureDecorator to avoid superfluous composition (#4734)
  • [Logging] Add RectorOutput logging service (#4736)
  • [DX] Cache rector test config loading by file + class to avoid booting over and over per fixture (#4718)
  • [DX] Validate rules no longer existing rules in $rectorConfig->skip() (#4728)
  • [DX] Merge RectorOutputStyle, OutputStyleInterface to RectorStyle (#4711)

Bugfixes 🐛

  • [TypeDeclaration] Do not change different type defualt value on StrictStringParamConcatRector (#4635)
  • [Strict] Skip docblock on BooleanInTernaryOperatorRuleFixerRector (#4638)
  • [Strict] Skip docblock on DisallowedShortTernaryRuleFixerRector (#4639)
  • [Strict] Skip docblock on BooleanInBooleanNotRuleFixerRector (#4640)
  • [TypeDeclaration] Using native type scope get on ReturnTypeInferer (#4648)
  • [CodingStyle][Php80][Privatization] Handle SeparateMultiUseImportsRector+ClassPropertyAssignToConstructorPromotionRector+FinalizeClassesWithoutChildrenRector cause invalid removal (#4649)
  • [DX] Cleanup ForRepeatedCountToOwnVariableRector counter (#4651)
  • [DX] Make MoneyFormatToNumberFormatRector wrap func call directly to keep simple (#4653)
  • Move ArrayManipulator to rector-symfony, where only used (#4656)
  • [DX] Move FlipNegatedTernaryInstanceofRector to instanceof rules category (#4663)
  • Resolve encapsed values as strings (#4622), Thanks @Bellardia!
  • [Privatization] Skip parent class unknown on PrivatizeFinalClassMethodRector (#4671)
  • [TypeDeclaration] Skip anonymous class and other object on ReturnUnionTypeRector (#4670)
  • [TypeDeclaration] Allow return anonymous class on ReturnTypeFromReturnNewRector (#4669)
  • [TypeDeclaration][CodeQuality] Move ReturnTypeFromStrictScalarReturnExprRector from CodeQuality to TypeDeclaration set (#4668)
  • [TypeDeclaration] Allow __invoke() method for return type changed on ClassMethodReturnTypeOverrideGuard (#4667)
  • [NodeTypeResolver] Clean up anonymous class detection on NodeTypeResolver::getNativeType() (#4673)
  • [NodeAnalyzer] Pass ReflectionProvider to __construct() on CallAnalyzer (#4699)
  • Skip code changes on unresolvable/unknown classes (#4619), Thanks @staabm!
  • [TypeDeclaration] Use return bool for ParentClassMethodTypeOverrideGuard::hasParentClassMethod(), return ?MethodReflection for ParentClassMethodTypeOverrideGuard::getParentClassMethod() (#4703)
  • [TypeDeclaration] Skip param setter method intersection docblock not autoload on ReturnNeverTypeRector (#4721)
  • [TypeDeclaration] Skip non void or never already return typed on ReturnNeverTypeRector (#4723)
  • Make relativeFilePathFromDirectory() private as used only locally (#4735)
  • [DX] Avoid supporting edge-case multi-layered comments, must be covered in php-parser itself (#4743)
  • [TypeDeclaration] Skip void type on caller on ReturnTypeFromStrictTypedCallRector (#4751)
  • Use direct VoidType definition on Return_ expr is null on ReturnedNodesReturnTypeInfererTypeInferer (#4752)
  • [Renaming] Deprecate PseudoNamespaceToNamespaceRector as too dynamic and unreliable, use the RenameClassRector instead (#4755)

Removed 💀

Since Rector 0.15 we declare type stricness and avoid docblock changes, as unreliable and could lead to incorrect assumptions: getrector.com/blog/new-in-rector-015-complete-safe-and-known-type-declarations

Few rules work with unreliable docblocks, and were removed. Instead handle cases yourself with PHPStan help 👍

  • [DX] Remove deprecated RectorConfigProvider, use SimpleParameterProvider instead (#4658)
  • [DX] Remove usage of deprecated symfony parameters (#4674)
  • Remove deprecated ArrayShapeFromConstantArrayReturnRector (#4662)
  • Remove RemoveParentRector as never used and only for demo purposes, handle custom way where needed (#4679)
  • [DX] Remove *AnnotationIncorrectNullableRector rules as works with unreliable docblocks and can have 2 solutions (#4719)
  • Remove appendArgs() method on AbstractRector (#4732)
  • [Renaming] Remove callables from class renames to avoid missed rename bugs, better handle with PHSPtan and custom rule (#4745)
  • [DX] Remove NullifyUnionNullableRector, let cs tools handle it (#4660)
  • [DX] Remove RemoveJustPropertyFetchRector as used for one time job, not practical for general use (#4661)
  • [TypeDeclaration] Remove AddClosureReturnTypeRector (#4637)
  • [DX] Remove AddDefaultValueForUndefinedVariableRector as can generate broken code and depends on context (#4729)

Don't miss a new rector release

NewReleases is sending notifications on new releases.