github rectorphp/rector 0.14.1
Released Rector 0.14.1

latest releases: 1.2.0, 1.1.1, 1.1.0...
22 months ago

New Features 🥳

Read on the blog: Support for Nested Doctrine Annotation to Flat Attributes in Rector 0.14

  • [PHP 8.0] Add NestedAnnotationToAttributeRector (#2781)
  • [PHP 8.0] Add way to adjust specifics attribute arguments (#2834)

  • [BetterPhpDocParser] Add ArrayItemNode to improve value transfer in annotation curly lists (#2786) (#2795)
  • + 20 % performance improvement by lazy loading resources (#2774), Thanks @ossinkine!
  • [PHP 8.0] Refactor ChangeSwitchToMatchRector to StmstAwareInterface (#2801)
  • [Naming] Add ArrowFunction support on RenameParamToMatchTypeRector (#2818)
  • Support for ConstFetch (true, false, null) in NodeFactory::createArrayItem (#2778), Thanks @xorik!
  • [PHP 7.4] Add MoneyFormatToNumberFormatRector (#2727)
  • [DX] Make tracy debug functions part of dev-only, so developers can use own debug style (#2848)
  • Add rector-debugging to require-dev (#2857)
  • Support for ConstFetch (true, false, null) in NodeFactory::createArrayItem (#2778), Thanks @xorik!
  • [PHP 8.0] Add custom JMS AccesorOrder explicit key (#2895)

Bugfixes 🐛

  • Handle crash on RenameFunctionRector+ForRepeatedCountToOwnVariableRector+CountOnNullRector+NullToStrictStringFuncCallArgRector (#2777)
  • [CodeQuality] Fix out-of-order items removal in UnusedForeachValueToArrayKeysRector (#2779)
  • [PHP 8.0] Keep quoted string with doublecolon in AnnotationToAttributeRector (#2784)
  • [PHP 8.0] Fix ChangeSwitchToMatchRector for next new variable re-use (#2798)
  • Fix generics and intersection in TypedPropertyRector (#7392) (#2800), Thanks @Khartir!
  • [CodeQuality] Add StaticCall support on OptionalParametersAfterRequiredRector (#2817)
  • [PHP 5.5] Make StringClassNameToClassConstantRector skip lcfirst (#2888)
  • [AutoImport] Handle auto import crash on docblock @SuppressWarnings(PHPMD.ElseExpression) inside anonymous class (#2808)
  • [CodingStyle] Skip translation functions on EncapsedStringsToSprintfRector (#2809)
  • [PHP 8.1] Handle crash backed Enum not implemented on FirstClassCallableRector (#2815)
  • [EarlyReturn] Do not remove previous If_ stmts on ChangeNestedIfsToEarlyReturnRector (#2820)
  • [EarlyReturn] Handle crash on assign in if else before on RemoveAlwaysElseRector (#2822)
  • [EarlyReturn] Skip ChangeAndIfToEarlyReturnRector in case of simple scalar return (#2826)
  • [EarlyReturn] Skip indirect return with define variable after parent else on ChangeAndIfToEarlyReturnRector (#2836)
  • [DeadCode] Skip object shape pseudo-type in RemoveNonExistingVarAnnotationRector (#2837)
  • [PHP 8.0] Handle single quoted is_granted on AnnotationToAttributeRector (#2842)
  • [DowngradePhp80/72] Handle DowngradeTrailingCommasInParamUseRector+DowngradeParameterTypeWideningRector (#2843)
  • [CodingStyle] Handle multiple assigns on SplitDoubleAssignRector (#2873)
  • [Testing] Use own FixtureFileFinder to keep dependency low (#2858)
  • [PHP 7.4] Add ParenthesizeNestedTernaryRector (#2859)
  • Fix class not found from Easy-Testing package (#2864)
  • [phpstan] Resolve duplicated methods (#2869)
  • [EarlyReturn] Skip else has inline html on RemoveAlwaysElseRector (#2870)
  • [Php55] Skip StringClassNameToClassConstantRector on case insensitive (#2896)
  • [Transform] Skip transitional interface in AddInterfaceByTraitRector (#2898)
  • [CodeQuality] Skip static::class on InlineConstructorDefaultToPropertyRector (#2899)

Inline Symplify Packages to Allow Changes in Single Place 👍

Based on community feedback, we've narrowed down few dependencies that Rector uses actively, but were maintained in external repository.
Inlining only the classes we need makes Rector easier to contribute as the code is available in the repository.

  • symplify/astral
  • symplify/package-builder
  • symplify/smart-file-system
  • symplify/symplify-kernel
  • symplify/skipper

Read on the blog: Tests Made Simpler

Apart making contributions simpler, the vendor is 10 % smaller, narrow from 1949 files to 1765 👍

  • [DX] Inline Skipper (#2877)
  • [DX] Remove internally SmartFileInfo, to save memory for every single file + service (#2876)
  • [DX] Reduce inner use of SmartFileInfo, and injected SmartFileSystem (#2847)
  • [DX] Inline symplify/astral to use only active classes (#2851)
  • [DX] Make use of FilePathHelper over inner magic of FileSystem in SmartFileInfo (#2862)
  • [tests] Use file paths over value objects in tests to improve performance (#2878)
  • [DX] Use own path normalizer (#2881)
  • [DX] Localize few PackageBuilder classes (#2884)
  • [DX] Remove PackageBuilder classes (#2885)

Removed 💀

  • [DeadCode] Merge RemoveDeadConstructorRector, to RemoveEmptyClassMethodRector with same behavior (#2829)
  • [DeadCode] Remove RemoveUnusedParamInRequiredAutowireRector, as one time job for private project; not useful for generic (#2830)
  • [CodeQuality] Remove SimplifyIfIssetToNullCoalescingRector, as overly complex and should be handled by manual context (#2828)
  • [Restoration] Remove CompleteImportForPartialAnnotationRector, one time custom job, not useful for generic rules (#2831)
  • [Transform] Remove ServiceGetterToConstructorInjectionRector, only for risky doctrine case, that should be handled manually (#2832)
  • [DX] Remove upgrade RectorConfig set, as last 2 version use only PHP (#2852)
  • [DX] Cleanup of text file processor, unused MultipleFilesChangedTrait and misc (#2861)
  • [DX] Remove composer-json-manipulator (#2871)
  • [DX] Remove the composer upgrade as unused to narrow focus back to PHP (#2871)

Symfony Rector 🎼

  • [Symfony 2.8] Make ServiceSetStringNameToClassNameRector skip classes used twice to avoid autowiring error (#232)

Doctrine Rector 🟠

Don't miss a new rector release

NewReleases is sending notifications on new releases.