github rectorphp/rector 2.8.4
Released Rector 2.8.4

4 hours ago

PHP 8.6 set additions and faster runs 🚀

This release grows the PHP 8.6 set with deprecated function alias renames, moves ConsistentImplodeRector down to the php74 set, and ships another round of performance work across the runner, printer, and reflection refresh.


New Features ⭐

  • Add PHP 8.6 deprecated function alias renames to php86 set (#8905)
  • Remove deprecated third arg of define() in php86 set (#8906)
  • Move ConsistentImplodeRector from php80 to php74 (#8894) Thanks @zoliszabo

Bugfixes 🐛

  • Run post rectors after the rules reach a fixed point, so no rule sees an imported short name (#8909) Thanks @SanderMuller
  • AnnotationToAttributeRector: fold unknown named args into the attribute's $options (#8914) Thanks @kix
  • [Php74] Fix MbStrrposEncodingArgumentPositionRector treating mixed $offset as encoding (#8913)
  • [DeadCode] Skip nested conditional assign in RemoveDefaultValueFromAssignedPropertyRector (#8915)
  • [DeadCode] Skip with HTML on RemoveAlwaysTrueIfConditionRector (#8896)
  • [Printer] Keep blank lines between statements when a node list is emptied (#8886)

Performance Improvements 🚀

  • Reduce double traversal on promoted property lookup in AstResolver (#8903)
  • Reuse File::containsHTML() on AddUseStatementGuard to cut a double traverse (#8899)
  • Reuse collected use statements when resolving PHPDoc short names (#8901)
  • Skip current file lookup when a rule makes no change in RectorRunner::run() (#8891)
  • Optimize class reflection refresh with cheaper cache hashing and early class-name validation (#8892)
  • Skip wrapBinaryOpWithBrackets() for CallLike nodes in BetterStandardPrinter::p() (#8890)

Internals ⚙️

  • Convert Doctrine annotations from phpdoc-parser nodes, remove StaticDoctrineAnnotationParser (#8881) Thanks @ondrejmirtes
  • Use PHPStan Type::toNativePhpTypeNode() and Type::toPhpDocNode() instead of own type mappers (#8885) Thanks @ondrejmirtes
  • Remove phpdoc-parser workarounds fixed in phpdoc-parser 2.3.10 and 2.3.11 (#8898) Thanks @ondrejmirtes
  • Bump minimal phpstan and phpdoc-parser to latest patch versions (#8916)
  • Make use of PHPStan InClassNode on PHPStanNodeScopeResolver (#8902)
  • [Core] Remove unneeded origNode attribute get on RectorRunner (#8893)
  • [Printer] Remove BetterStandardPrinter::pExpr_Ternary() method (#8887)
  • [Printer] Remove @property for $insertionMap on BetterStandardPrinter (#8888)

Don't miss a new rector release

NewReleases is sending notifications on new releases.