github rectorphp/rector 1.04
Released Rector 1.0.4

latest releases: 1.0.5, 1.0.4
one month ago

New Features and Changes 🥳

  • [DeadCode] Add RemoveUselessReadOnlyTagRector (rectorphp/rector-src@ef333de)
  • [DeadCode] Add new rule - ReduceAlwaysFalseIfOrRector (rectorphp/rector-src@0dd1a43)
  • [Transform] Adds ArrayDimFetchToMethodCallRector rule (#5723), Thanks @peterfox!
  • [Printer] Add configurable multiline on Fluent Method Call on print after method call created/re-printed (#5779)
  • [Php84] Add ExplicitNullableParamTypeRector (#5724)
  • Add support for getOneOrNullResult() method in ChildDoctrineRepositoryClassTypeRector (#5747)
  • [CodeQuality] Add ExplicitReturnNullRector (#5753)
  • Add rector test suite to phpunit.xml or phpunit.xml.dist (#5717), Thanks @ghostwriter!
  • [Php82] Add VariableInStringInterpolationFixerRector (#5781)

Bugfixes 🐛

  • [DeadCode] Skip isset() from property fetch from docblock on RemoveAlwaysTrueIfConditionRector (#5754)

  • [DeadCode] Skip implements interface on RemoveUnusedConstructorParamRector (#5778)

  • [DeadCode] Remove union with interface on RemoveUselessParamTagRector to make it consistent (#5794)

  • [DeadCode] Skip property fetch on cond as may be overridden on RemoveAlwaysTrueIfConditionRector (#5796)

  • [DeadCode] Skip @param true on native bool type on RemoveUselessParamTagRector (#5798)

  • [php84] Clean up contains null check type on ExplicitNullableParamTypeRector (#5726)

  • Fixes for ArrayDimFetchToMethodCallRector (#5727), Thanks @peterfox!

  • Update ArrayDimFetchToMethodCall to use ObjectType (#5728), Thanks @peterfox!

  • [Php81] Skip $this::class on trait on NullToStrictStringFuncCallArgRector (#5732)

  • Handle readonly class with attrs (#5736), Thanks @tugmaks!

  • [Renaming][AutoImport] Handle after change annotation to attribute with rename on AnnotationToAttributeRector + RenameClassRector with auto import (#5741)

  • [Php80] Skip var property usage on ClassPropertyAssignToConstructorPromotionRector (#5744)

  • [Php80] Use identical compare on PromotedPropertyCandidateResolver (#5745)

  • Fix ChildDoctrineRepositoryClassTypeRector for generic type (#5746)

  • [DeadCode] Skip From docblock on ReduceAlwaysFalseIfOrRector (rectorphp/rector-src@f32dff3)

  • [CodeQuality] Skip if else return on ExplicitReturnNullRector (#5755)

  • [CodeQuality] No need to re-update doc when already union null doc on ExplicitReturnNullRector (#5757)

  • [CodeQuality] Skip constructor on ExplicitReturnNullRector (#5758)

  • [CodeQuality] Move Yield_ and YieldFrom check to SilentVoidResolver (#5759)

  • [CodeQuality] Skip do { } while always returned on ExplicitReturnNullRector (rectorphp/rector-src@cae0691)

  • [CodeQuality] Allow transform return; to return null; when there is other return with Expr on ExplicitReturnNullRector (#5761)

  • [AutoImport] Allow auto import same namespace with sub use with docblock short name (rectorphp/rector-src@e3e741e)

  • [CodeQuality] Handle do { } while maybe returned on ExplicitReturnNullRector (#5766)

  • [DeadCode] Fix array callable with constructor args (#5770), Thanks @hogejiro!

  • [TypeDeclaration] Ensure always return with Expr on maybe continued in next stmt on SilentVoidResolver (#5771)

  • [NodeCollector] Fix non-string value on ArrayCallableMethodMatcher::resolveClassContextType() (#5780)

  • [TypeDeclaration] Handle initialized on getter on ReturnTypeFromStrictTypedPropertyRector (#5784)

  • [TypeDeclaration] Handle in inner function on ReturnTypeFromStrictTernaryRector (#5785)

  • [TypeDeclaration] Do not use Required::class reference on AutowiredClassMethodOrPropertyAnalyzer (#5788)

  • Fix removal of useless @param tag when string|null insteadof ?string is used. (rectorphp/rector-src@9b4ad93)

  • [NodeTypeResolver] Move UnionType doc vs FullyQualified native type as not equal to TypeComparator (#5793)

  • Support @immutable phpdoc in RestoreDefaultNullToNullableTypePropertyRector (rectorphp/rector-src@3f1ccb3)

  • [CodeQuality] Skip Switch_ always returned on ExplicitReturnNullRector (#5800)

  • [CodeQuality] Handle Switch maybe return on ExplicitReturnNullRector (#5801)

  • [DeadCode] Skip use docblock on BooleanAnd check on RemoveDeadInstanceOfRector (#5751)


Removed 💀

  • [code-quality] Remove intval/strval from sets, as no clear difference and personal preference (#5721)
  • [CodeQuality] Remove BoolvalToTypeCastRector and FloatvalToTypeCastRector as well from code-quality set (#5722)
  • [DeadCode] Skip Array Callable dynamic method using CLASS with constructor (no default args) on RemoveUnusedPrivateMethodRector (rectorphp/rector-src@eb525ca)
  • [Php81] Remove @readonly doc on transformation to native readonly on ReadOnlyPropertyRector (#5789)

Don't miss a new rector release

NewReleases is sending notifications on new releases.