packagist rector/rector 0.12.10
Released Rector 0.12.10

latest releases: dev-main, 1.0.5, 1.04...
2 years ago

Thank you all for amazing year 2021!

This year...

  • we've released a book with @matthiasnoback where you can learn Rector in depth in days,
  • we've added static reflection that allows analyzing legacy projects,
  • we develop Rector on PHP 8.1 and release downgraded to PHP 7.1
  • and most importantly, you contribute more and more rules and fixes every month ❤️

Thank you from whole Rector team 🙇


We've prepared one 🎁 , that will make your life much easier in 2022...


Experimental - Parallel Run 🥳️

This release brings new exciting feature. The more threads your CPU has, the faster can Rector get. It's brand new feature, so we look for bleeding edge testers to try it out:

// rector.php
use Rector\Core\Configuration\Option;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

return static function (ContainerConfigurator $containerConfigurator): void {
    $parameters = $containerConfigurator->parameters();

	$parameters->set(Option::PARALLEL, true);
};
  • [Parallel] Add serializable object passing to FileProcessors (#1583)
  • [Parallel] Tidy up (#1585)
  • [Parallel] Improve tests to use file processor over file analyzer + fix missing RectorWithLineChange de/serialization (#1584)

New Features 🎉

  • [DowngradePhp80] Add #[\ReturnTypeWillChange] on DowngradeMixedTypeDeclarationRector on implements ArrayAccess (#1552), Thanks @samsonasik!
  • [DowngradePhp80] Add DowngradeArrayFilterNullableCallbackRector (#1593), Thanks @samsonasik!
  • [DowngradePhp70] Add DowngradeMethodCallOnCloneRector (#1559), Thanks @samsonasik!
  • [DowngradePhp56] Add DowngradeArrayFilterUseConstantRector (#1573), Thanks @samsonasik!
  • [Downgrade PHP 7.4] Add false to downgraded typed property (#1596)
  • [TypeDeclaration] AddVoidReturnTypeWhereNoReturnRector turns @return never into less specific @return void (#1553), Thanks @staabm!
  • [Transform][Php81] Add configurable ReturnTypeWillChangeRector (#1548), Thanks @samsonasik!
  • [DX] Avoid reporting deprecated errors (#1577)
  • Update to PHPStan ^1.3 (#1589), Thanks @samsonasik!

Bugfixes 🐛

  • [Php81] Skip assign coalesce with new in inner class on NewInInitializerRector (#1547), Thanks @samsonasik!
  • [Php80] Handle optional, required, optional on OptionalParametersAfterRequiredRector (#1555), #6879, Thanks @staabm!
  • [TypeDeclaratoin] Add AccessoryLiteralStringType to static type mapper (#1558)
  • [Php74] Skip protected property on final class with parent not loaded on TypedPropertyRector (#1560), Thanks @samsonasik!
  • [TypedProperty] Add property type guard in case of parent class (#1563)
  • [TypeDeclaration] Fix ParamTypeByParentCallTypeRector union type printing (#1564)
  • [TypeDeclaration] Fix ReturnTypeAlreadyAddedChecker on return key of array (#1571), Thanks @samsonasik!
  • [TypeDeclaration] Skip controller render method on @var to type declaratoin (#1576)
  • [TypeDeclaration] Skip callable on return type of control (#1572)
  • [TypeDeclaration] Add symfony route annotation support (#1578)
  • [PHP 8.1] Skip abstract class in NewInInitializerRector (#1581)
  • [Php81] Skip ReadOnlyPropertyRector on Clone $this (#1599), Thanks @samsonasik!
  • [TypeDeclaration] Include trait in AddVoidReturnTypeWhereNoReturnRector (#1582)
  • Fix faking scope context for trait reflections (#1575), Thanks @zingimmick!
  • [PHPStanStaticTypeMapper] Do not crash on numeric string on ReturnTypeDeclarationRector (#1588), Thanks @samsonasik!
  • fix: add failing test and fix for repeated numeric strings (#1594), Thanks @internalsystemerror!
  • [DeadCode] Fix remove unreachable after mark test skipped (#1602), Thanks @jtojnar!

Don't miss a new rector release

NewReleases is sending notifications on new releases.