github rectorphp/rector 2.4.6
Released Rector 2.4.6

9 hours ago

New Features 🥳

  • [deprecation] Add RenameDeprecatedMethodCallRector inferring rename from @deprecated docblock (#8015)
  • [sets] kick of named args set (#8013)
# rector.php
return (RectorConfig::configure())
    ->withPreparedSets(namedArgs: true);
  • Add Symfony 8 to the set provider collector (#8019), Thanks @mbabker!

Bugfixes 🐛

  • [BetterPhpDocParser] Keep import referenced by @see/@uses tag with a trailing description (#8039), Thanks @ruudk!
  • [internals] skip and finalize beforeTraverse() and afterTraverse() as never used, use refactor() instead (#7765)
  • [DeadCode] Skip (void) cast with #[NoDiscard] on target method call on RemoveDeadStmtRector (#8038)
  • Bump composer/pcre to ^3.4.0 and phpstan/phpstan to ^2.2.2 (#8037)
  • [CodeQuality] Handle crash on custom exception not autoloaded on ThrowWithPreviousExceptionRector (#8036)
  • refactor: extract AutoloadFileParameterResolver from bin, add tests (#8035), Thanks @SanderMuller!
  • Fix cached results surviving a change of --autoload-file (#8034), Thanks @SanderMuller!
  • [CodingStyle] Remove AstResolver usage on ArrowFunctionAndClosureFirstClassCallableGuard (#8031)
  • [DeadCode] Remove AstResolver on RemoveParentCallWithoutParentRector (#8032)
  • [DeadCode] Skip with use of func_num_args() on RemoveNullArgOnNullDefaultParamRector (#8030)
  • [Php70] Skip rewriting to $this on static method or static closure on StaticCallOnNonStaticToInstanceCallRector (#8026)
  • [ci] add compat test (#8025)
  • Fix ReplaceArgumentDefaultValueRector generating invalid self:: constant in unrelated classes (#8023)
  • Fix RemoveDeadIfBlockRector dropping else block when merging empty if with elseif (#8022)
  • Fix RemoveParentCallWithoutParentRector removing valid call when ancestor hierarchy is unresolvable (#8018)
  • split of RemoveNullNamedArgOnNullDefaultParamRector to handle only named args (#8014)
  • Add failing tests (#8012), Thanks @u01jmg3!
  • Update rector/swiss-knife version to ^2.4.1 (#8011)

rectorphp/rector-symfony 🎶

  • [Symfony81] Add new rule for deprecated validator test usages (#948), Thanks @florianhofsaessC24!
  • fix: only convert Twig extensions fully reducible to AsTwig attributes (#947)
  • [Symfony73] Sort optional parameters last in InvokableCommandInputAttributeRector (#945)
  • Add PHPStan rule requiring nested set configs to be imported in parent set config (#943)
  • [Symfony81] Add new rule for Security component (#942), Thanks @MrYamous!
  • Remove unused imports (#941), Thanks @MrYamous!
  • [Symfony81] Add new rule for Filesystem (#940), Thanks @MrYamous!

rectorphp/rector-phpunit 🟢

  • [PHPUnit12] Handle crash on property not exists on PropertyCreateMockToCreateStubRector (#681)
  • [AnnotationsToAttributes] Convert external @Depends ClassName::method to #[DependsExternal] (#679)
  • [PHPUnit12] Drop ConstraintValidatorTestCase from AllowMockObjectsWhereParentClassRector triggers (#678)

rectorphp/rector-downgrade-php ⬇️

  • Add DowngradeDomNodeChildNodesForeachRector for null $childNodes before PHP 8.0 (#379)
  • Update boundwize/structarmed version to ^0.9 (#378)
  • Fix use of existing PhpAttributeAnalyzer service on AddReturnTypeWillChangeAttributeRector (#377)
  • Remove no longer exists '--ansi' flag from swiss-knife (#376)
  • [DowngradePhp81] Add AddReturnTypeWillChangeAttributeRector (#372), Thanks @jquiaios!

Don't miss a new rector release

NewReleases is sending notifications on new releases.