chore(deps): update dependency rector/rector to ^0.19.0 #6

Open
renovate-bot wants to merge 1 commit from renovate/rector-rector-0.x into master
Collaborator

This PR contains the following updates:

Package Change Age Confidence
rector/rector (source) ^0.15.24^0.19.0 age confidence

Release Notes

rectorphp/rector (rector/rector)

v0.19.8: Released Rector 0.19.8

Compare Source

New Features 🥳

  • [experimental] Add withTypeCoverageLevel() method to streamline Rector integration to new projects (#​5553)

Bugfixes 🐛

  • Cache null result on ProjectComposerJsonPhpVersionResolver (#​5559)
  • Real fix paths The given paths do not match any files on RectorConfigBuilder (#​5561)

v0.19.7: Released Rector 0.19.7

Compare Source

Bugfixes 🐛

  • [TypeDeclaration] Skip assign in construct with method call property same name on RestoreDefaultNullToNullableTypePropertyRector (#​5556)
  • [Privatization] Fix reprint with attribute on FinalizeTestCaseClassRector (#​5557)
  • [DX] Fix missing Rector\RectorGenerator\Exception\ConfigurationException (#​5558)
  • Fix platform version resolution, use require first (#​5555)
  • bump template version (rectorphp/rector-src@02a088c)

v0.19.6: Released Rector 0.19.6

Compare Source

New Features and Changes 🥳

  • [EarlyReturn] Improve RemoveAlwaysElseRector to handle multiple ElseIfs (#​8178) (#​5521), Thanks @​pkvach!
  • [Privatization] Add FinalizeTestCaseClassRector (#​5539)
  • Add support for YieldFrom into places where Yield_ is checked (#​5499), Thanks @​integer!
  • [Transform] Add RectorConfigBuilderRector (#​5551)
  • [DX] Warn about run on /vendor directory (#​5525)
  • [DX] PHP sets should not disable all other version-based rules (#​5527)
  • [stabilize] Deprecate FinalizeClassesWithoutChildrenRector as causing bugs without full context (#​5535)

Bugfixes 🐛

  • Fix xdebug handling (#​5544), Thanks @​staabm!
  • Added 4 methods into RectorConfigBuilder (#​5524), Thanks @​Perf!
  • Fix AddMethodCallBasedStrictParamTypeRector if already has a type (#​5530)
  • [CodingStyle] Return null on no change on StrictArraySearchRector (#​5528)
  • [Php81] Allow nullable union on NullToStrictStringFuncCallArgRector (#​5532)
  • [stabilize] Deprecate FinalizePublicClassConstantRector as not reliable and causes uncontroller changed (#​5534)
  • [TypeDeclaration] Change bool to false or true docblock when union has false/true standalone type on ReturnUnionTypeRector (#​5543)
  • [EarlyReturn] Skip append variable in PreparedValueToEarlyReturnRector (#​8390) (#​5545), Thanks @​pkvach!
  • Fix make ReadOnlyPropertyRector skip if traits are used, as not reliable (#​5548)
  • Kick off basic rector.php with simpler and more practical rule (#​5552)

Removed 💀

  • Exclude finalize rule from private set, to keep safer (#​5523)
  • [Performance] Remove CollectedData on ProcessResult (#​5520)
  • [stabilize] Remove family tree check from ClassMethodParamVendorLockResolver as not reliable (#​5536)
  • [stabilize] Remove child classes from MixedTypeRector as not reliable (#​5537)
  • [stabilize] Remove last children method checks (#​5538)

v0.19.5: Released Rector 0.19.5

Compare Source

New Features 🎉

  • [Autoloading] Allow to define bootstrapFiles([DIR . '/some.phar']) on BootstrapFilesIncluder (#​5518)
  • add withPhpSets() methods (#​5519)

v0.19.4: Released Rector 0.19.4

Compare Source

Bugfixes 🐛

v0.19.3: Released Rector 0.19.3

Compare Source

New Features ahd Changes 🥳

  • [Config] Add RectorConfigBuilder (#​5503)
  • Add gitlab to "setup-ci" command (#​5497)
  • Add "custom-rule" command to make creating rules easy (#​5498)
  • [Windows] Rework add windows support on tests CI (#​5504)
  • make literal separator optional, as rather coding style and not always desired (#​5505)

Bugfixes 🐛

  • [Php70] Skip inside Encapsed on ThisCallOnStaticMethodToStaticCallRector (#​5481)
  • [Performance] Cache PHP version features on reading composer.json on PhpVersionProvider (#​5484)
  • Fix phpstan (#​5489)
  • [Config] Restore default values for RectorConfig->parallel() config similar to original <=0.18.x version (#​5472)
  • [Performance][PhpParser] Deprecate InlineCodeParser::parse(), extract into parseFile() and parseString() (#​5482)
  • [CodeQuality] Skip surplus open square bracket on SimplifyRegexPatternRector (#​5494)
  • [AutoImport] Skip start with <?= short open tag on auto import (#​5496)
  • [Testing] Deprecate FileInfoParser, use existing TestingParser instead (#​5501)
  • custom copy path fix (#​5502)
  • [DX] Allow Arg in value resolver, as often used and intuitive (#​5512)
  • [Windows] Support replace \r\n on DocBlockInliner (#​5513)
  • [Php83] add string type to concat constant (#​5516), Thanks @​jdohuutin!

Removed 💀

  • [Renaming] Remove namespace renames in ClassRename, as it should only rename references, not move to new namespace (#​5487)
  • [Renaming] Remove rename class name (#​5488)

v0.19.2: Released Rector 0.19.2

Compare Source

New features and Changes 🎉

  • [DX] Depreate heavy and conflicting Symfony/Twig/PHPUnit level sets (#​5477)
  • Remove collectors, as performance very costly and not practically useful (#​5470)

Bugfixes 🐛

  • Fix repeated timeouts on CI - #​8403, #​8396
  • Bump PHPStan to 1.10.56 (#​5471)
  • Remove collector interface and fix SpatieEnumClassToEnumRector already has underscore to double underscore (#​5473)
  • [DX] Depreate heavy and conflicting Symfony/Twig/PHPUnit level sets (#​5477)

Removed 💀

  • [Performance] Remove unused AttributeKey::ARGUMENT_POSITION (#​5469)
  • [Autoload] Remove src/core_namespace_aliases.php (#​5476)

v0.19.1

Compare Source

v0.19.0: Released Rector 0.19.0

Compare Source

In this release we merged 2 directories into /src to speed up class loading and make work with code easier. This leads to BC change in namespace for your custom rules:

-use Rector\Core\
+use Rector\

That's it!

New Features 🥳

  • [psr-4] Move /packages directory to /src under single Rector\ namespace (#​5414)
  • [Arguments] Allow no default value on ArgumentAdderRector (#​5382)
  • Add related polyfill interface to other PHP 8.0/7.3 rules (#​5389)
  • [CodingStyle] Add RemoveUselessAliasInUseStatementRector (#​5394)
  • [Php83] Add CombineHostPortLdapUriRector (#​5397)
  • [TypeDeclaration] optionally only add types for hard coded return values in ReturnTypeFromStrictScalarReturnExprRector (#​5364), Thanks @​RobertMe!
  • Add phpstan native cond types for getName() for nodes that always return a string (#​5413)
  • [Strict] Add StaticProperty supporton may be unitialized static property on DisallowedEmptyRuleFixerRector (#​5428)
  • [Php83] Add implements interface support on AddOverrideAttributeToOverriddenMethodsRector (#​5429)
  • [cs] Make use of new ECS config (#​5445)

Bugfixes 🐛

  • [TypeDeclaration] Add false and true in union support on ReturnUnionTypeRector (#​5355)
  • Skip classes without final and exception as possibly invoke child implement in AddVoidReturnTypeWhereNoReturnRector (#​5381)
  • Skip non-final class method with no content in AddVoidReturnTypeWhereNoReturnRector (#​5386)
  • [TypeDeclaration] Allow add void return type on magic __invoke() method on AddVoidReturnTypeWhereNoReturnRector (#​5376)
  • Add ReturnTypeFromStrictBoolReturnExprRector support for if/else returns (#​5384)
  • Skip void without final keyword in ReturnNeverTypeRector as could be implemented with more precise children (#​5379)
  • Fix StrictArrayParamDimFetchRector for string access (#​5383)
  • Fix variable to property fetch update in ClassPropertyAssignToConstructorPromotionRector (#​5385)
  • [Php] Fix filter cache on PolyfillPackagesProvider (#​5390)
  • [Parallel] Fix missing --xdebug in WorkerCommand line on WorkerCommandLineFactory when --xdebug provided (#​5398)
  • Bump phpstan to 1.10.50 (#​5399)
  • [Php83] Handle dynamic host and port values on CombineHostPortLdapUriRector (#​5401)
  • [config] Extract RectorConfigValidator and handle config validation there (#​5404)
  • [psr-4] Update Rector core test reference (#​5410)
  • [cleanup] Decouple changelog generator (#​5412)
  • [Strict] Handle may be unitialized property on DisallowedEmptyRuleFixerRector (#​5409)
  • Bump min. version to PHP 8.2 - readonly classes (#​5415)
  • Decouple LongAndDependentComplexRectorRule to cognitive-complexity package (#​5427)
  • [TypeDeclaration] Skip with empty() check on StrictArrayParamDimFetchRector (#​5432)
  • [TypeDeclaration] Allow both integer and string index array on StrictArrayParamDimFetchRector (#​5433)
  • [TypeDeclaration] Skip re-assign with call and use as arg on StrictArrayParamDimFetchRector (#​5434)
  • [CodeQuality] Handle crash with call inside loop on SimplifyForeachToCoalescingRector (#​5436)
  • [TypeDeclaration] Handle with default null on ParamTypeByMethodCallTypeRector (#​5437)
  • [NodeTypeResolver] Handle crash PHPStan\File\CouldNotReadFileException: Could not read file on IntermediateSourceLocator (#​5438)
  • Allows to convert Spatie enum names to snake upper case (#​5435), Thanks @​JoolsMcFly!
  • fix: RenameMethodRector should handle NullsafeMethodCall (#​5444), Thanks @​nikophil!
  • [Php80][CodeQuality] Handle crash on ChangeSwitchToMatchRector + TernaryFalseExpressionToIfRector on under if else (#​5446)
  • Skip cond with side effect in RemoveDeadConditionAboveReturnRector (#​5424)
  • [DeadCode] Skip nullable array on RemoveUnusedNonEmptyArrayBeforeForeachRector (#​5375)
  • Keep called method in RemoveEmptyClassMethodRector (#​5425)

Removed 💀

  • [DeadCode] Remove RemoveJustPropertyFetchForAssignRector as tailored for single case of private project, not practical for generic use (#​5418)
  • remove array spread from coding style, as often part of personal preference (rectorphp/rector-src@a326b85)

v0.18.13: Released Rector 0.18.13

Compare Source

New Features 🥳

  • [DeadCode] Add Function_ support on RemoveUselessReturnTagRector (#​5325)
  • [TypeDeclaration] Add MergeDateTimePropertyTypeDeclarationRector (#​5327)
  • [DeadCode] Add Function_ support on RemoveUselessParamTagRector (#​5331)
  • [DeadCode] Add RemoveNullTagValueNodeRector (#​5352)

Bugfixes 🐛

  • [Php83] Fix const from applying incorrect types (#​5326), Thanks @​peterfox!
  • [TypeDeclaration] Fix missing change type to DateTimeInterface on MergeDateTimePropertyTypeDeclarationRector (#​5329)
  • [TypeDeclaration] Handle DateTimeInterface from use statement on MergeDateTimePropertyTypeDeclarationRector (#​5330)
  • [TypeDeclaration] Handle assign $this on TypedPropertyFromAssignsRector (#​5333)
  • Fix array type if property is used in TypedPropertyFromStrictConstructorRector (#​5339)
  • [Naming] Skip DateTimeImmutable on RenamePropertyToMatchTypeRector (#​5340)
  • [PHP 7.4] Skip typed properties in the set, as standalone set now available (#​5342)
  • [TypeDeclaration] Skip has child return different type on ReturnNeverTypeRector (#​5343)
  • [Experiment][TypeDeclaration] Allow change abstract class methods with body on ReturnType*Rector (#​5344)
  • [Php55] Make StringClassNameToClassConstantRector configurable to keep first pre-backslash string configurable (#​5354)
  • [TypeDeclaration] Skip casted to (array) on StrictArrayParamDimFetchRector (#​5356)
  • [TypeDeclaration] Return new static from different object on ReturnTypeFromStrictTypedCallRector (#​5357)
  • [TypeDeclaration] Allow return static from under function on ReturnTypeFromStrictTypedCallRector (#​5358)
  • [Naming] Skip $this in RenameForeachValueVariableToMatchExprVariableRector (#​5360), Thanks @​sreichel!
  • [Transform] Do not create a new node if the existing node is already the correct one on AttributeKeyToClassConstFetchRector (#​5328), Thanks @​SerethiX!
  • Bump to php parser 4.18 (#​5362)
  • [CodeQuality] Skip Superglobals variable on SimplifyEmptyCheckOnEmptyArrayRector (#​5369)
  • [Php55] Handle crash after exit() on GetCalledClassToSelfClassRector (#​5372)
  • [CodeQuality] Skip method call on else on TernaryFalseExpressionToIfRector (#​5373)
  • Remove return type in case of never in RemoveUselessReturnTagRector (#​5323), Thanks @​staabm!
  • [DeadCode] Remove unused @​return mixed on RemoveUselessReturnTagRector (#​5332)
  • [DeadCode] Skip has parent class with __call() magic method on RemoveParentCallWithoutParentRector (#​5336)
  • [PHP 5.5] Remove extra preslash in class reference, as in practice removal manually (#​5338)
  • [DeadCode] Remove null as never used param type in RemoveUselessParamTagRector (#​5348)
  • Remove json throw on error rule from PHP 7.3 set, as changed behavior and must be applied on purpose (#​5349)
  • [Testing] Remove unnecessary set Parameter Source on TestingParser (#​5371)

v0.18.12: Released Rector 0.18.12

Compare Source

New Features 🥳

  • [CodeQuality] Add RemoveUselessIsObjectCheckRector (#​5316)
  • [PHP83] Implements a rule to add types to class constants (#​5290), Thanks @​peterfox!

Bugfixes 🐛

  • [TypeDeclaration] Skip iterable already there in AddReturnTypeDeclarationFromYieldsRector (#​5291)
  • [TypeDeclaration] Remove ParamTypeFromStrictTypedPropertyRector as seems similar feature with AddParamTypeFromPropertyTypeRector (#​5293)
  • [CodingStyle] Remove AddArrayDefaultToArrayPropertyRector as based on docblock types and public contract, better use type declaration set instad (#​5298)
  • [TypeDeclaration] Skip return void in abstract empty class in AddVoidReturnTypeWhereNoReturnRector (#​5311)
  • [Php80] Skip PDO::query() on AddParamBasedOnParentClassMethodRector (#​5313)
  • [TypeDeclaration] Add If else assign support on TypedPropertyFromAssignsRector (#​5314)
  • [CodeQuality] Make CommonNotEqualRector skip if not <> (#​5292)
  • [Naming] Skip singularize "cms" on RenameForeachValueVariableToMatchExprVariableRector (#​5294)
  • [TypeDeclaration][Performance] Check typed param already early on ParamTypeByMethodCallTypeRector (#​5295)
  • [Strict] Fix DisallowedEmptyRuleFixerRector empty() allow string '0' check (#​5296)
  • [EarlyReturn] Skip duplicating complex expression in ChangeAndIfToEarlyReturnRector (#​5301)
  • [Scoped] Exclude symfony/console/Debug/CliRequest.php from parallel-lint PHP 7.2 syntax check (#​5304)
  • Skip RenameMethodRector in never (#​5305), Thanks @​staabm!
  • [CodeQuality] Skip with else on SimplifyForeachToCoalescingRector (#​5307)
  • [Doc] Typo fix on sample code documentation on SimplifyForeachToCoalescingRector (#​5308)
  • [Privatization] Skip call non-private method on non-final class on PrivatizeLocalGetterToPropertyRector (#​5309)
  • [Privatization] Fix first class callable in PrivatizeLocalGetterToPropertyRector (#​5310)
  • [TypeDeclaration] Keep constant false return type from strict native call (#​5223), Thanks @​tomi85!
  • [PHP 7.0] Skip mt_rand() replacement as not valuable (#​5315)
  • [Strict] Allow check '0' empty zero on BooleanInTernaryOperatorRuleFixerRector on string type (#​5297)
  • Fix annotation to attribute parsing string (#​5317)
  • [Instanceof] Fix combination of dead instance and compare (#​5319)
  • Remove isPositiveInteger() check for third argument to strpos() (#​5257), Thanks @​ikari7789!
  • Remove return type in case of void in RemoveUselessReturnTagRector (#​5318)
  • [DeadCode] Skip @​return never with void on RemoveUselessReturnTagRector (#​5320)
  • [DeadCode] Remove useless nullable @​return doc on RemoveUselessReturnTagRector (#​5321)

v0.18.11: Released Rector 0.18.11

Compare Source

Bugfixes 🐛

  • [DeadCode] Skip multi no stmts on RemoveDuplicatedCaseInSwitchRector (#​5258)
  • [Performance][Renaming] Remove unnecessary array_reverse() on RenameClassRector (#​5266)
  • [TypeDeclaration] Skip default not array type on StrictArrayParamDimFetchRector (#​5259)
  • [TypeDeclaration] Skip echo-ed on StrictArrayParamDimFetchRector (#​5260)
  • [Php71] Skip re-assigned as array on AssignArrayToStringRector (#​5261)
  • [Php71] Ensure re-assign after definition on AssignArrayToStringRector (#​5262)
  • [Renaming] Handle Rename no namespace to namespaced class with existing use statements (#​5264)
  • [Renaming][Performance] Re-structure check namespace only on renamed node got Namespace_ (#​5265)
  • [Php81] Skip increment/decrement on ReadOnlyPropertyRector (#​5267)
  • [TypeDeclaration] Deprecate TypedPropertyFromStrictGetterMethodReturnTypeRector as depends on missing context and creates invalid code (#​5269)
  • [AutoImport] Fixing auto import on multiple @​\ usage (#​5271)
  • [Performance][Renaming] Use FullyQualified on RenameClassRector (#​5272)
  • [AutoImport] Handle complex usage of multiple @​\ combined with other doc (#​5273)
  • [AutoImport] Handle multi @​\ usage on multiline description (#​5274)
  • [Php80] Handle FQCN @​\ usage on AnnotationToAttributeRector (#​5240)
  • [BetterPhpDocParser] Handle nested doctrine annotation with single quote content (#​5281)
  • [Privatization] Skip method with parent call (#​5283)
  • [BetterPhpDocParser] Use ORIG_NODE attribute on DoctrineAnnotationDecorator on handle @​\ after generic (#​5285)
  • [Php80] Allow subnamespace from use statements support on AnnotationToAttributeRector (#​5287)

Removed 💀

  • Remove deprecated Rector rules (#​5270)

v0.18.10: Released Rector 0.18.10

Compare Source

Bugfixes 🐛

  • [Renaming] FQN-ize namespaced import no namespace -> namespaced name on RenameClassRector (#​5256)

v0.18.9: Released Rector 0.18.9

Compare Source

New Features 🥳

  • [DeadCode]: Support functions in RemoveUnusedVariableAssignRector (#​5249
  • [Performance][PostRector] Only process FullyQualified on import Node name on NameImportingPostRector (#​5255)

Bugfixes 🐛

  • [AutoImport][Php70] Keep FQCN on conflict last name on TernaryToNullCoalescingRector (#​5251)
  • [Naming] Fix dotted name on generics bug in RenameVariableToMatchMethodCallReturnTypeRector (#​5250)
  • [Php73] Handle crash on JsonThrowOnErrorRector + SensitiveConstantNameRector (#​5253)
  • [CodingStyle] Refactor UseImportsAdder to return [FileWithoutNamespace] code on no namespaced code (#​5254)

v0.18.8: Released Rector 0.18.8

Compare Source

Bugfixes 🐛

  • Bump to reactphp/event-loop ^1.5 (#​5246)
  • [AutoImport] Skip auto import on no namespace used class on auto import enabled (#​5247)
  • [AutoImport][Renaming] Handle same last name no namespace just renamed auto import (#​5248)

v0.18.7: Released Rector 0.18.7

Compare Source

New Features 🥳

  • [CodeQuality] Add negated support on SingleInArrayToCompareRector (#​5205)
  • [Php83] Adds rule for adding Override attribute (#​5170), Thanks @​peterfox!

Bugfixes 🐛

  • BinaryOpBetweenNumberAndStringRector don't trust phpdoc (#​5199), Thanks @​staabm!
  • [CodeQuality][Php70] Handle LocallyCalledStaticMethodToNonStaticRector + ThisCallOnStaticMethodToStaticCallRector must change both method and caller (#​5196)
  • CountArrayToEmptyArrayComparisonRector: don't trust phpdoc (#​5203), Thanks @​staabm!
  • [TypeDeclaration] Skip union false on NumericReturnTypeFromStrictScalarReturnsRector (#​5204)
  • [CodeQuality] Handle negated isset on IssetOnPropertyObjectToPropertyExistsRector on property not exists (#​5206)
  • [CodeQuality] Handle crash no scope on ThrowWithPreviousExceptionRector+OptionalParametersAfterRequiredRector (#​5207)
  • [NodeTypeResolver] Clean up TryCatch_ Scope filling (#​5208)
  • [PHPStanStaticTypeMapper] Clean up tweak false and bool check on UnionTypeMapper (#​5209)
  • [TypeDeclaration] Skip default numeric string on param int on ParamTypeByMethodCallTypeRector (#​5210)
  • [AutoImport] Handle AnnotationToAttributeRector + RenameClassRector then enable auto import (#​5213)
  • [Php80] Keep single quoted Argument Attribute on AnnotationToAttributeRector (#​5214)
  • [Php80] Keep single quoted key: 'value' on AnnotationToAttributeRector (#​5215)
  • [AutoImport] Ensure change to FullyQualified for Attribute on just changed from annotation (#​5216)
  • [Php52][Php70] Handle ContinueToBreakInSwitchRector + BreakNotInLoopOrSwitchToReturnRector (#​5217)
  • [Php80] Handle RenameClassRector+AnnotationToAttributeRector with auto import and existing attribute defined (#​5219)
  • [Testing] In case of failed test using multiple rules, show applied Rector rules to make easy to find them (#​5222)
  • [NodeTypeResolver] Handle nullable extended class on ->isObjectType() on DowngradeReflectionGetAttributesRector (#​5224)
  • NullableCompareToNullRector: Don't trust phpdocs (#​5225), Thanks @​staabm!
  • [CodingStyle] Move ArraySpreadInsteadOfArrayMergeRector from php74 to codingstyle sets list (#​5230)
  • [PostRector] Ensure old classes in use statements cleaned up after rename attribuet on ClassRenamingPostRector (#​5231)
  • RestoreDefaultNullToNullableTypePropertyRector: skip @readonly phpdoc (#​5233), Thanks @​staabm!
  • [AutoImport] Handle DeclareStrictTypesRector on importNames() enabled on no namespace (#​5241)
  • [AutoImport] Allow auto import just renamed @​var only docblock on RenameClassRector without removeUnusedImports() enabled (#​5220)
  • Remove rule DataProviderArrayItemsNewlinedRector.php (#​5227), Thanks @​eerison!
  • Remove ArraySpreadInsteadOfArrayMergeRector from LevelSetList::UP_TO_PHP_74 (#​5228), Thanks @​staabm!
  • [DeadCode] Allow indirect duplicated grouping on RemoveDuplicatedCaseInSwitchRector (#​5234)
  • [DeadCode] Reduce double loop on RemoveDuplicatedCaseInSwitchRector (#​5235)
  • [DeadCode] Handle different indirect duplicated on RemoveDuplicatedCaseInSwitchRector (#​5236)
  • [DeadCode] Ensure change hasChanged flag on RemoveDuplicatedCaseInSwitchRector (#​5237)
  • [DeadCode] Handle repetitive jump equal case stmts on RemoveDuplicatedCaseInSwitchRector (#​5239)
  • Rename parameter variable to nextCase on RemoveDuplicatedCaseInSwitchRector (#​5244)

v0.18.6: Released Rector 0.18.6

Compare Source

New Features and Changes 🥳

  • [CodeQuality] Add CompleteMissingIfElseBracketRector (#​5121)
  • [CodeQuality] Add Else and ElseIf on CompleteMissingIfElseBracketRector (#​5124)
  • [TypeDeclaration] Utilize ClassMethodReturnTypeOverrideGuard on AddReturnTypeDeclarationFromYieldsRector (#​5156)
  • [DeadCode] Add RemoveUselessReturnExprInConstructRector (#​5158)
  • Improve UnaryPlus and UnaryMinus support in isDynamicExpr (#​5177), Thanks @​JulianCBC!

Bugfixes 🐛

  • [CodeQuality] Skip VB style if endif on CompleteMissingIfElseBracketRector (#​5122)
  • [CodeQuality] Skip direct InlineHTML on CompleteMissingIfElseBracketRector (#​5125)
  • [CodeQuality] Skip spaced elseif cond on CompleteMissingIfElseBracketRector (#​5126)
  • [CodeQuality] Only check start from current Stmt token pos up until open parentheses on CompleteMissingIfElseBracketRector (#​5127)
  • [CodeQuality] Handle all if,elseif,else no bracket on CompleteMissingIfElseBracketRector (#​5129)
  • [CodeQuality] Skip VB style in complex HTML on CompleteMissingIfElseBracketRector (#​5132)
  • Skip __construct() in BoolReturnTypeFromStrictScalarReturnsRector (#​5133), Thanks @​staabm!
  • [CodeQuality] Handle missing bracket on If only on CompleteMissingIfElseBracketRector (#​5134)
  • [CodeQuality] Handle on closure, anonymous function, method call on CompleteMissingIfElseBracketRector (#​5135)
  • [CodeQuality] Use its start token pos on Else_ on CompleteMissingIfElseBracketRector as no cond (#​5136)
  • [PhpParser] Reduce AstResolver complexity by move check fileName is null to parseFileNameToDecoratedNodes() (#​5138)
  • [TypeDeclaration] Handle Union with array type on ReturnUnionTypeRector (#​5144)
  • [TypeDeclaration] Handle union A extends B on ReturnUnionTypeRector (#​5149)
  • [CodeQuality] Fix missing parentheses on CombineIfRector (#​5151)
  • [TypeDeclaration] Utilize ClassMethodReturnTypeOverrideGuard on NumericReturnTypeFromStrictScalarReturnsRector (#​5155)
  • [CodeQuality] Handle negative and positive int/float on InlineConstructorDefaultToPropertyRector (#​5159)
  • [CodeQuality] Skip docblock usage on SimplifyBoolIdenticalTrueRector (#​5161)
  • [CodeQuality] Skip magic property fetch on IssetOnPropertyObjectToPropertyExistsRector (#​5163)
  • [PostRector] Reduce loop on ClassRenamingPostRector (#​5174)
  • [PostRector] Fix ClassRenamingPostRector return when no auto import replacement (#​5175)
  • [Renaming] Skip nullable object object|null on RenameMethodRector (#​5181)
  • [Downgradephp81][DowngradePhp80] Handle No scope crash on DowngradeSetAccessibleReflectionPropertyRector + DowngradeMatchToSwitchRector (#​5183)
  • [Naming] Skip DateTime from renaming, to keep convention of named dates (#​5184)
  • Skip new self in RenameVariableToMatchNewTypeRector (#​5185)
  • Skip DateTime in ExpectedNameResolver (#​5186)
  • [Naming] Skip all kinds of generators (#​5187)
  • [Renaming] Skip pointless names in RenameForeachValueVariableToMatchMethodCallReturnTypeRector (#​5188)
  • [Php70] Fix Php4 contructor not replaced with __construct() on php 7.4 environment (#​5189)
  • [Php74][Php81] Allow mixed key on ArraySpreadInsteadOfArrayMergeRector on php 8.1 version feature enabled (#​5190)
  • [TypeDeclaration] Handle skipped by file path on DeclareStrictTypesRector due to use beforeTraverse() (#​5191)
  • Fix phpstan notice $phpVersion on Rector\Config\RectorConfig::phpVersion() (#​5193)
  • [PHPStanStaticTypeMapper] Remove BoolUnionTypeAnalyzer on UnionTypeMapper (#​5141)
  • [DeadCode] Remove UnionType check on RecastingRemovalRector (#​5142)
  • Remove src/constants.php for T_ENUM and T_NAME_RELATIVE (#​5143)
  • [PHPStanStaticTypeMapper] Remove narrow string and int on UnionTypeMapper (#​5145)
  • [PHPStanStaticTypeMapper] Remove matchArrayTypes() on UnionTypeMapper (#​5146)
  • [DeadCode] Skip indirect variable definition on RemoveNonExistingVarAnnotationRector (#​5152)
  • [DeadCode] Skip key used in next stmt on RemoveUnusedForeachKeyRector (#​5153)
  • [DeadCode] Skip used in next For_/Foreach_ on RemoveDeadIfForeachForRector (#​5154)
  • [DeadCode] Handle file_get_contents() only remove variable on RemoveUnusedVariableAssignRector (#​5162)
  • [DeadCode] Skip count() on mixed on RemoveUnusedNonEmptyArrayBeforeForeachRector (#​5160)
  • RemoveUnusedNonEmptyArrayBeforeForeachRector: ignore phpdoc types (#​5169), Thanks @​staabm!
  • RemoveUnusedNonEmptyArrayBeforeForeachRector: skip array dim fetch (#​5166), Thanks @​staabm!
  • [DeadCode] Skip return false pseudo type in union on RemoveUselessReturnTagRector (#​5172)
  • [AutoImport] [Renaming] Skip remove used use statement on annotation during rename + auto import when no replacement on auto import (#​5168)
  • [DeadCode] Mirror comment on assign method call on RemoveUnusedVariableAssignRector (#​5195)

v0.18.5: Released Rector 0.18.5

Compare Source

New Features and Improvements 🥳

  • [build] Remove duplicated phpstan/phpstan from the build, as require by build package in composer.json already (rectorphp/rector-src@51ed7b6)
  • AddParamTypeBasedOnPHPUnitDataProviderRector: Check all data providers (#​5068), Thanks @​jlherren!
  • AddParamTypeBasedOnPHPUnitDataProviderRector: Enhance existing rule to handle PHPUnit 10+ DataProvider Attribute (#​4925), Thanks @​mcampbell508!
  • make PhpDocInfo::findByAnnotationClass() public to use in Symfony rules (#​5103)

Bugfixes 🐛

  • Feature/fix class annotation bad print (#​5081), Thanks @​etshy!
  • [Performance] Avoid ReflectionProvider check function exists on NameImportingPostRector (#​5083)
  • InlineConstructorDefaultToPropertyRector Readonly Class (#​5085), Thanks @​beschoenen!
  • [CodeQuality] Handle crash on variable variable on assign closure on OptionalParametersAfterRequiredRector (#​5089)
  • [NodeTypeResolver] Use isScalar()->yes() usage on StaticTypeAnalyzer and ScalarTypeComparator services (#​5099)
  • [ProcessAnalyzer] Ensure instanceof Stmt on check infinite loop on not yet has "created_by_rule" attribute (#​5100)
  • [DX] Rename shouldImportName() to shouldSkipName() on ClassNameImportSkipper (#​5107)
  • The ReturnTypeFromReturnNewRector must only handle new instances, to avoid leaking to everything (#​5115)
  • [Php80] Skip when already implements Stringable and has string return type on StringableForToStringRector (#​5120)

Removed and Deprecated 💀

  • [DX] Remove CurrentFileProvider dependency on ChangedNodeScopeRefresher (#​5087)
  • [DX] Remove DependencyClassMethodDecorator as not used anymore due to paralel nature (#​5094)
  • [PostRector] Remove CurrentFileProvider on PostFileProcessor (#​5097)
  • [Comments] Remove unused copy Node object on CommentRemover (#​5103)
  • [Performance][AutoImport] Remove just renamed check on ClassNameImportSkipper (#​5106)
  • Deprecate CountOnNullRector as depends on previous context and require manual adjustment of previous result (#​5101)

v0.18.4: Released Rector 0.18.4

Compare Source

New Features and Improvements 🥳

  • Introducing Collectors 🥳 - processing collected data + test case (#​4970)
  • Run tests on macos (#​5019), Thanks @​staabm!
  • Move betterNodeFinder, valueResolver, phpDocInfoFactory dependencies from AbstractRector into rules (#​5071)
  • DX: Validate paths in RectorConfig->paths() (#​5065), Thanks @​staabm!
  • [DX] Make PhpDocInfoFactory explicitly required in Rector rule constructor, if needed (#​5051)
  • [DX] Make ValueResolver explicitly required in Rector rules constructor if needed (#​5052)

Bugfixes 🐛

  • [DeadCode] RemoveDeadZeroAndOneOperationRector should not remove Constants (#​4910), Thanks @​TwanVermeulen!
  • [PostRector] Fix unused import not removed on empty generic class name exists (#​5012)
  • [Parallel] Handle Spaced root project main script on parallel process (#​4813)
  • Fix TypedPropertyFromStrictConstructor* order (#​5021), Thanks @​staabm!
  • [DX] Lower current node dependency - pass it directly to doc node parsing (#​5023)
  • [AutoImport] Fix conflict current namespace auto import (#​5024)
  • Simplify UseIdenticalOverEqualWithSameTypeRector (#​5029), Thanks @​staabm!
  • [Performance][Testing] Use str_contains instead of regex in FixtureSplitter (#​5030)
  • Fix ArrayKeyFirstLastRector: Skip exection when pointer is changed (#​5038), Thanks @​scyzoryck!
  • [TypeDeclaration] Handle fallback from param same type object on ReturnTypeFromReturnNewRector (#​5039)
  • [NodeTypeResolver] Use Scope->getType() on ArrayDimFetch on NodeTypeResolver::getNativeType() (#​5037)
  • [NodeTypeResolver] pull getType() on ArrayDimFetch when not mixed type from its variable native definition (#​5056)
  • [CodingStyle][EarlyReturn] Fix infinite if else on BinarySwitchToIfElseRector+RemoveAlwaysElseRector (#​5057)
  • [TypeDeclaration] Skip ArrayDimFetch for return and param types (#​5059), Thanks @​staabm!
  • [NodeTypeResolver] Handle optional array shape on native function like with ArrayDimFetch (#​5062)
  • [Php80] Mirror switch comment to match to ChangeSwitchToMatchRector (#​5072)
  • [AutoImport] Skip case insensitive conflict defined class name on $rectorConfig->importNames() (#​5076)
  • Docblock fix on ShortNameResolver (#​5077)
  • [TypeDeclaration] Add return static property support on ReturnTypeFromStrictTypedPropertyRector (#​5050)

Removed and Deprecated 💀

  • [Config] Remove asterisk support in import() for file, use explicit paths instead (#​5010)
  • [Performance] Remove regex check on open tag spaced check on FileProcessor (#​5073)
  • Deprecate TypedPropertyFromStrictConstructorReadonlyClassRector as based on docblock and public elements; use private elements and property promotion instead (#​5049)
  • Deprecate BinarySwitchToIfElseRector as opinionated to allow more suitable match() refactoring (#​5064)

v0.18.3: Released Rector 0.18.3

Compare Source

New Features and Changes 🥳

  • [BC] docblock changes in custom Rector rules now have to be reprinted directly in the rule - #​8201 (comment)
  • [TypeDeclaration] Add return empty string defined support on ReturnTypeFromStrictScalarReturnExprRector (#​4919)
  • [TypeDeclaration] Add fallback return direct array support on ReturnTypeFromStrictNewArrayRector (#​4928)
  • [TypeDeclaration] Add init assign method call support on ReturnTypeFromStrictNewArrayRector (#​4929)
  • [TypeDeclaration] Ensure ArrayType on ReturnTypeFromStrictNewArrayRector::shouldAddReturnArrayDocType() (#​4932)
  • [TypeDeclaration] Add test fixture return docblock on init method call assign as skipped on ReturnTypeFromStrictNewArrayRector (#​4933)
  • [TypeDeclaration] Add non native function return support on ReturnTypeFromStrictScalarReturnExprRector (#​4934)
  • BC: Separated regex matching in NodeNameResolver->isName() (#​4951), Thanks @​staabm!
  • Add support for Custom Skip Voters (#​5002), Thanks @​kaczenski!
  • Implement a max jobs per worker budget (#​4965), Thanks @​staabm!
  • Prevent unnecessary calls to spl_object_id() (#​4992), Thanks @​staabm!
  • Refactor use import resolving (#​4998), Thanks @​staabm!
  • NodeNameResolver: Throw exception in BC breaking path (#​4980), Thanks @​staabm!
  • [Internals] Decouple output from AbstractRector, narrow debugging output to file path (#​4976)
  • Update docblock only when changed, directly in rector rule (#​4986)

Bugfixes 🐛

  • AddVoidReturnTypeWhereNoReturnRector: fix never type handling (#​4918), Thanks @​staabm!
  • [TypeDeclaration] Skip return after return closure on AddVoidReturnTypeWhereNoReturnRector (#​4930)
  • [TypeDeclaration] Use $type->isScalar()->yes() on AlwaysStrictScalarExprAnalyzer (#​4920)
  • Refactor BetterNodeFinder::findFirstInFunctionLikeScoped() to work with SilentVoidResolver (#​4931)
  • [NodeTypeResolver] Handle isObjectType() on new $class dynamic variable should return false compare to Object FQCN (#​4936)
  • [Testing] Fix running unit test on macOS (#​4941)
  • Faster name resolving (#​4955), Thanks @​staabm!
  • UseImportsTraverser: don't deep traverse (#​4994), Thanks @​staabm!
  • [tests] Replace wildcard e2e test with unit one (#​5000)
  • [DocBlock] Update docblock contents right in the rule (#​4999)
  • [PhpParser] Fix crash read jetbrains/phpstorm-stubs included in phpstan.phar on PHP 8.0 and PHP 7.4 (#​5001)
  • RenameFunctionRector: prevent repeated isName() calls (#​5003), Thanks @​staabm!
  • Make PhpDocINfo::removeByType() return bool to inform about changed node (#​4979)

Removed 💀

  • [cleanup] Remove deprecated NonPhpRectorInterface, PseudoNamespaceToNamespaceRector and mysql to mysqli sets (#​4927)
  • Remove UnSpreadOperatorRector as not clear value and spread used on purpose (#​4949)
  • [Naming] Remove matchesStringName() check completely from NodeNameResolver, including endsWith() method - use getName() and compare directly instead (#​4954)
  • [Performance][Php55] Remove regex replace e on RegexMatcher (#​4974)
  • Remove CurrentRectorProvider and used for docblock changes report, return bool value and node directly in the rector rule instead (#​4982)
  • Deprecated PhpDocInfo::markAsChanged() to ensure doc block is changed directly in the Rector rule (#​4987)

v0.18.2: Released Rector 0.18.2

Compare Source

New Features and Changes 🥳

  • Add MyCLabs enum equals + keeping methods (#​4645), Thanks @​K0nias!
  • [TypeDeclaration] skip variadic constructor param of mixed type on AddParamTypeFromPropertyTypeRector (#​4887), Thanks @​Celebrate-Reinhard!
  • [TypeDeclaration] Do not add default value when assigned in __construct() on TypedPropertyFromStrictGetterMethodReturnTypeRector (#​4886)
  • [TypeDeclaration] Add ReturnTypeFromStrictFluentReturnRector (#​4890)
  • Add single value concat support to EncapsedStringsToSprintfRector (#​4897)
  • Add number support to concat EncapsedStringsToSprintfRector (#​4898)
  • [DeadCode] Remove @​return void on return self on RemoveUselessReturnTagRector (#​4894)
  • Add test case for caching $rectorConfig->rules() changed (#​4903)
  • [CodeQuality] Add NumberCompareToMaxFuncCallRector (#​4914)
  • [TypeDeclaration] Add return self object support on ReturnTypeFromStrictFluentReturnRector (#​4915)
  • [TypeDeclaration] Add return static object support on ReturnTypeFromStrictFluentReturnRector (#​4916)

Bugfixes 🐛

  • [Caching] Add VersionResolver::PACKAGE_VERSION to FileHashComputer::compute() so cache cleared on composer update got new version (#​4904)
  • [TypeDeclaration] Using ClassMethodReturnTypeOverrideGuard on ReturnTypeFromStrictParamRector (#​4878)
  • [e2e] $rectorConfig->skip() should not skip inside different path over config (#​4882)
  • Fix missing default string in TypedPropertyFromStrictGetterMethodReturnTypeRector (#​4885)
  • Fix tests fixture updater (#​4892)
  • Fix union type check of object (#​4893)
  • Simplify isMatchingUnionType() (#​4895), Thanks @​staabm!
  • Skip identical to false in SimplifyBoolIdenticalTrueRector, as exact comparison is stronger than negated expression (#​4901)
  • Fix Rector invalidation in case of changes sets or rules (#​4902)
  • [TypeDeclaration] Skip mixing native + docblock union assign on TypedPropertyFromAssignsRector (#​4905)
  • StrictArrayParamDimFetchRector: Skip objects (#​4907), Thanks @​staabm!
  • FamilyRelationsAnalyzer: final classes can't have children (#​4913), Thanks @​staabm!
  • [Config] Remove $isBound usage as cause empty configuration on RectorConfig (#​4880)

v0.18.1: Released Rector 0.18.1

Compare Source

This release is accompanied by 2 posts that explains behind the scenes context:


New Features and Changes 🥳

  • [CI] Narrow tests to single job, as now takes 20 s 🚀 (#​4827)
  • [Config] Handle $rectorConfig->import() with wildcards * config (#​4832)
  • [DX] Display rule count in list-rules (#​4848)
  • Skip PHPDoc return type in AddReturnTypeDeclarationBasedOnParentClassMethodRector (#​4809), Thanks @​staabm!
  • AddReturnTypeDeclarationBasedOnParentClassMethodRector: don't trust phpdoc types (#​4810), Thanks @​staabm!
  • [DX] Add optional testdox/pest like output to get exact test metrics per unit test fixture (#​4821)
  • [TypeDeclaration] Add new array replaced with array on ReturnTypeFromStrictNewArrayRector (#​4825)
  • [DX] Merge PhpRectorInterface to RectorInterface as identical contract and separation no longer needed (#​4812)
  • [PHPStan] Avoid removing bleeding edge from phar include, let user handle own phpstan configuration (#​4840)

Bugfixes 🐛

  • [Php73][Php80] Handle empty long array syntax default value on SensitiveConstantNameRector+AddParamBasedOnParentClassMethodRector (#​4837)
  • [Config] Add merging of rules configuration, call configure() just once (#​4838)
  • Fix RenamePropertyToMatchTypeRector to skip Laravel collections and avoid accident rename (#​4811)
  • [BetterPhpDocParser] Enable textBetweenTagsBelongsToDescription on BetterPhpDocParser extends PhpDocParser (#​4817)
  • [PHPUnit] Fix extreemely slow PHPUnit run on data providers with objects (#​4823)
  • [AutoImport] Handle case insensitive name collide on auto import (#​4829)
  • [Traverser] Set explicitely nodeConnectingVisitorCompatibility: false config in config/phpstan/static-reflection.neon (#​4841)
  • replaces get_headers $associative with bool (#​4850), Thanks @​mvhirsch!
  • [Php55][Renaming] Handle rename string on combination StringClassNameToClassConstantRector+RenameStringRector (#​4869)
  • [Php80] Handle crash parent default empty array/string param on AddParamBasedOnParentClassMethodRector (#​4833)

Removed 💀

  • Remove deprecated FileProcessorInterface (#​4835)
  • Remove SwapFuncCallArgumentsRector as keeps swaping to infinity, use custom rule instead (#​4874)

v0.18.0: Released Rector 0.18.0 with Laravel container

Compare Source

New Features and Changes 🥳

  • [DI] Switch container to Laravel - final step 🥳 (#​4698)
    • do you use $rectorConfig->import('src/*'); with mask?
    • this is removed now, use explicit real paths instead
  • [DI] Remove symfony/dependency-injection dependency (#​4796)
  • [DI] Add symfony config BC warnings layer, to inform about an upgrade (#​4800)
  • Add possibility to add multiple phpstan configs (#​4798), Thanks @​alexander-schranz!
  • [DX] Make use of addParameter() (#​4801)
  • Add deprecation warning for FileProcessorInterface (#​4808)

Bugfixes 🐛

  • [DeadCode] Handle duplicated annotation on space before close parentheses on RemoveUselessParamTagRector (#​4795)
  • Fix skip() Rector class, make container forget it comleteely (#​4807)

v0.17.13: Released Rector 0.17.13

Compare Source

New Features and Changes 🥳

  • [TypeDeclaration] Skip in conditional on AddParamTypeFromPropertyTypeRector (#​4779)
  • [DX] Deprecate NonPhpRectorInterface, the only rule and its file processor, to make Rector handle exlusively PHP (#​4761)
  • Bump nikic/php-parser to 4.17 (#​4781)

Removed 💀

  • Remove SwapMethodCallArgumentsRector as could lead to infinite swapping, use custom rule with type/value check instead (#​4766)
  • [Php81] Remove IntersectionTypesRector as rely on docblock (#​4784)

Bugfixes 🐛

  • [DeadCode] Skip used by trait on RemoveUnusedPrivateMethodRector (#​4770)
  • [DeadCode] Skip used by trait inside Closure on RemoveUnusedPrivateMethodRector (#​4773)
  • [e2e] Handle $rectorConfig->paths() with wilcards * config (#​4765)
  • [Config] Move from magic loading of all PHPStan extensions, their bootstrap files etc. under control with explicit file listing (#​4769)
  • [TypeDeclaration] Handle crash on concat param append returned used on Arg on StrictStringParamConcatRector (#​4774)
  • [TypeDeclaration] Skip param re-assign on Strict Param rules (#​4775)
  • [TypeDeclaration] Skip param int on StrictStringParamConcatRector (#​4780)
  • [PHPStanStaticTypeMapper] Allow Closure type on ClosureTypeMapper based on PHP versions (#​4785)
  • [PHPStanStaticTypeMapper] Allow standalone null type on NullTypeMapper on php 8.2 (#​4783)
  • Make SimplifyUselessVariableRector run without scope (#​4791)
  • Make NullToStrictStringFuncCallArgRector run without scope (#​4792)

v0.17.12

Compare Source

v0.17.11: Released Rector 0.17.11

Compare Source

New Features and Improvements 🥳

  • [TypeDeclaration] Add nullable param from null compare on StrictStringParamConcatRector (#​4636)
  • [TypeDeclaration] Add ReturnUnionTypeRector (#​4655)
  • [TypeDeclaration] Skip public method on AddMethodCallBasedStrictParamTypeRector (#​4659)
  • [CodeQuality][TypeDeclaration] Add string append support on ReturnTypeFromStrictScalarReturnExprRector (#​4657)
  • [TypeDeclaration] Handle anonymous class in union on AddArrowFunctionReturnTypeRector (#​4676)
  • [Types] Make AddVoidReturnTypeWhereNoReturnRector work only with type-declaration, as reliable (#​4720)
  • [TypeDeclaration] Allow change multiple methods on AddParamTypeDeclarationRector (#​4727)
  • [DX] Add ProcessConfigureDecorator to avoid superfluous composition (#​4734)
  • [Logging] Add RectorOutput logging service (#​4736)
  • [DX] Cache rector test config loading by file + class to avoid booting over and over per fixture (#​4718)
  • [DX] Validate rules no longer existing rules in $rectorConfig->skip() (#​4728)
  • [DX] Merge RectorOutputStyle, OutputStyleInterface to RectorStyle (#​4711)

Bugfixes 🐛

  • [TypeDeclaration] Do not change different type defualt value on StrictStringParamConcatRector (#​4635)
  • [Strict] Skip docblock on BooleanInTernaryOperatorRuleFixerRector (#​4638)
  • [Strict] Skip docblock on DisallowedShortTernaryRuleFixerRector (#​4639)
  • [Strict] Skip docblock on BooleanInBooleanNotRuleFixerRector (#​4640)
  • [TypeDeclaration] Using native type scope get on ReturnTypeInferer (#​4648)
  • [CodingStyle][Php80][Privatization] Handle SeparateMultiUseImportsRector+ClassPropertyAssignToConstructorPromotionRector+FinalizeClassesWithoutChildrenRector cause invalid removal (#​4649)
  • [DX] Cleanup ForRepeatedCountToOwnVariableRector counter (#​4651)
  • [DX] Make MoneyFormatToNumberFormatRector wrap func call directly to keep simple (#​4653)
  • Move ArrayManipulator to rector-symfony, where only used (#​4656)
  • [DX] Move FlipNegatedTernaryInstanceofRector to instanceof rules category (#​4663)
  • Resolve encapsed values as strings (#​4622), Thanks @​Bellardia!
  • [Privatization] Skip parent class unknown on PrivatizeFinalClassMethodRector (#​4671)
  • [TypeDeclaration] Skip anonymous class and other object on ReturnUnionTypeRector (#​4670)
  • [TypeDeclaration] Allow return anonymous class on ReturnTypeFromReturnNewRector (#​4669)
  • [TypeDeclaration][CodeQuality] Move ReturnTypeFromStrictScalarReturnExprRector from CodeQuality to TypeDeclaration set (#​4668)
  • [TypeDeclaration] Allow __invoke() method for return type changed on ClassMethodReturnTypeOverrideGuard (#​4667)
  • [NodeTypeResolver] Clean up anonymous class detection on NodeTypeResolver::getNativeType() (#​4673)
  • [NodeAnalyzer] Pass ReflectionProvider to __construct() on CallAnalyzer (#​4699)
  • Skip code changes on unresolvable/unknown classes (#​4619), Thanks @​staabm!
  • [TypeDeclaration] Use return bool for ParentClassMethodTypeOverrideGuard::hasParentClassMethod(), return ?MethodReflection for ParentClassMethodTypeOverrideGuard::getParentClassMethod() (#​4703)
  • [TypeDeclaration] Skip param setter method intersection docblock not autoload on ReturnNeverTypeRector (#​4721)
  • [TypeDeclaration] Skip non void or never already return typed on ReturnNeverTypeRector (#​4723)
  • Make relativeFilePathFromDirectory() private as used only locally (#​4735)
  • [DX] Avoid supporting edge-case multi-layered comments, must be covered in php-parser itself (#​4743)
  • [TypeDeclaration] Skip void type on caller on ReturnTypeFromStrictTypedCallRector (#​4751)
  • Use direct VoidType definition on Return_ expr is null on ReturnedNodesReturnTypeInfererTypeInferer (#​4752)
  • [Renaming] Deprecate PseudoNamespaceToNamespaceRector as too dynamic and unreliable, use the RenameClassRector instead (#​4755)

Removed 💀

Since Rector 0.15 we declare type stricness and avoid docblock changes, as unreliable and could lead to incorrect assumptions: getrector.com/blog/new-in-rector-015-complete-safe-and-known-type-declarations

Few rules work with unreliable docblocks, and were removed. Instead handle cases yourself with PHPStan help 👍

  • [DX] Remove deprecated RectorConfigProvider, use SimpleParameterProvider instead (#​4658)
  • [DX] Remove usage of deprecated symfony parameters (#​4674)
  • Remove deprecated ArrayShapeFromConstantArrayReturnRector (#​4662)
  • Remove RemoveParentRector as never used and only for demo purposes, handle custom way where needed (#​4679)
  • [DX] Remove *AnnotationIncorrectNullableRector rules as works with unreliable docblocks and can have 2 solutions (#​4719)
  • Remove appendArgs() method on AbstractRector (#​4732)
  • [Renaming] Remove callables from class renames to avoid missed rename bugs, better handle with PHSPtan and custom rule (#​4745)
  • [DX] Remove NullifyUnionNullableRector, let cs tools handle it (#​4660)
  • [DX] Remove RemoveJustPropertyFetchRector as used for one time job, not practical for general use (#​4661)
  • [TypeDeclaration] Remove AddClosureReturnTypeRector (#​4637)
  • [DX] Remove AddDefaultValueForUndefinedVariableRector as can generate broken code and depends on context (#​4729)

v0.17.10: Released Rector 0.17.10

Compare Source

New Features 🥳

  • [TypeDeclaration] Add Closure support on NumericReturnTypeFromStrictScalarReturnsRector (#​4631)
  • [TypeDeclaration] Add Closure support on StrictArrayParamDimFetchRector (#​4632)
  • [TypeDeclaration] Add Closure support on ReturnTypeFromStrictParamRector (#​4633)
  • [TypeDeclaration] Add Closure support on StrictStringParamConcatRector (#​4634)

Bugfixes 🐛

  • [Downgrade] [FIX] Fix infinite loop in DowngradeArrayFilterNullableCallbackRector (#​150)

v0.17.9: Released Rector 0.17.9

Compare Source

Bugfixes 🐛

v0.17.8: Released Rector 0.17.8

Compare Source

New Features 🥳

  • [TypeDeclaration] Add Closure support on BoolReturnTypeFromStrictScalarReturnsRector (#​4610)
  • AddMethodCallBasedStrictParamTypeRector: Support changing protected methods in final classes (#​4611), Thanks @​staabm!
  • [TypeDeclaration] Add StrictStringParamConcatRector (#​4624)

Bugfixes 🐛

  • [PHPStanStaticTypeMapper] FQCN for Closure type mapper (#​4584)
  • Fixed constant types handling in TypedPropertyFromStrictConstructorRector (#​4588), Thanks @​staabm!
  • [TypeDeclaration] Skip coalesce on StrictArrayParamDimFetchRector (#​4589)
  • Bump to phpdoc-parser 1.23 and fill construct() attributes (#​4590)
  • [TypeDeclaration] Skip override string on StrictArrayParamDimFetchRector (#​4591)
  • [Autoloading] Using SimpleParameterProvider on BootstrapFilesIncluder (#​4592)
  • [Php81] Fix regression skip call by ref on ReadOnlyPropertyRector (#​4593)
  • [PHPStanStaticTypeMapper] Make use of toPhpDocNode() on ObjectTypeMapper (#​4581)
  • [PHPStanStaticTypeMapper] Fix IntersectionTypeMapper to make ObjectType have FQCN (#​4598)
  • [Php81] Skip re-assign with AssignOp on ReadOnlyPropertyRector (#​4600)
  • Reduce ConstExprClassNameDecorator overhead (#​4603), Thanks @​staabm!
  • Resolve native return-type from native union-type in short ternary (#​4606), Thanks @​staabm!
  • [Strict] Skip from docblock @​return on DisallowedEmptyRuleFixerRector (#​4608)
  • [Strict] Skip @​return docblock on BooleanInIfConditionRuleFixerRector (#​4609)
  • [Php81] Fix regression skip call by ref on ReadOnlyPropertyRector on non __construct method (#​4614)
  • [CodeQuality][Strict] Handle infinite loop on SimplifyDeMorganBinaryRector+SimplifyIfReturnBoolRector+DisallowedEmptyRuleFixerRector (#​4615)
  • [CodingStyle][Namespace_] Support constant imports (#​4612), Thanks @​natepage!
  • [Php81] Skip property fetch from new static on ReadOnlyPropertyRector (#​4617)
  • [CodingStyle] Handle crash on empty cases on BinarySwitchToIfElseRector (#​4618)
  • Fix string type on StrictArrayParamDimFetchRector (#​4623)
  • [PHPStanStaticTypeMapper] Handle crash on DowngradeMixedTypeDeclarationRector for PHPStan\Type\ConditionalType (#​4625)
  • [Php73] Handle crash Type Error on JsonThrowOnErrorRector (#​4626)
  • [Php81] Skip call by ref on ReadOnlyPropertyRector on FuncCall (#​4630)
  • [Printer] Fix printing PHPStan AlwaysRememberedExpr with add unwrapper inside BetterStandardPrinter::p (#​4629)
  • [TypeDeclaration] Skip has parent class method on AddParamTypeFromPropertyTypeRector (#​4627)

Removed 💀

  • [Printer] Remove has InlineHTML node check after apply changes on PhpFileProcessor (#​4601)

v0.17.7: Released Rector 0.17.7

Compare Source

New Features 🥳

  • [CodingStyle] Skip filled by construct on AddArrayDefaultToArrayPropertyRector (#​4549)
  • Add constuctor support to ReplaceArgumentDefaultValueRector (#​4554)
  • StaticMapper: added fast path for IdentifierTypeNode (#​4565), Thanks @​staabm!
  • Add ReturnTypeFromStrictParamRector (#​4501), Thanks @​staabm!
  • Add TypedPropertyFromStrictConstructorReadonlyClassRector (#​4552), Thanks @​staabm!
  • ReturnTypeFromStrictTernaryRector: Support complex ternaries (#​4515), Thanks @​staabm!

Bugfixes 🐛

  • Support final methods in ClassMethodReturnTypeOverrideGuard (#​4509), Thanks @​staabm!
  • Support literals in ReturnTypeFromStrictTypedCallRector (#​4511), Thanks @​staabm!
  • [TypeDeclaration] Null stmts check early on ReturnTypeFromStrictParamRector (#​4512)
  • [Performance] Use filtered filePaths from ApplicationFileProcessor::configurePHPStanNodeScopeResolver on WorkerRunner::run() (#​4513)
  • [DX] Show progress bar 100% on RectorConsoleOutputFormatter::report() (#​4516)
  • [ChangesReporting] Reuse defined errors vairable on ConsoleOutputFormatter (#​4517)
  • [ApplicationFileProcessor] Refactor ApplicationFileProcessor to filter file paths early before run both parallel and non-parallel (#​4519)
  • [DX] Fix hang on twice run after all files processed cached (#​4521)
  • [Application] Move filter files by config extensions to FileFactory (#​4522)
  • [Php81][Php82][Privatization] Handle extends non-readonly class on ReadOnlyPropertyRector+ReadOnlyClassRector+FinalizeClassesWithoutChildrenRector (#​4524)
  • Fix wrong results in RemoveAlwaysElseRector (#​4527), Thanks @​jlherren!
  • Support class-const-fetch in ReturnTypeFromStrictTypedCallRector (#​4520), Thanks @​staabm!
  • [EarlyReturn] Skip append variable on PreparedValueToEarlyReturnRector (#​4530)
  • Refactor MyCLabs\Enum\Enum::equals calls to comparisons (#​4532), Thanks @​rojtjo!
  • [Performance][NodeManipulator] Avoid loop on search first variable named on next sliced next stmts on StmtsManipulator (#​4537)
  • [Performance] [TypeDeclaration] Reduce resolve ClassReflection on each property on TypedPropertyFromStrictConstructorRector (#​4536)
  • [Performance][TypeDeclaration] Reduce resolve ClassReflection from Property on AllAssignNodePropertyTypeInferer (#​4539)
  • [Application] Merge process files on both parallel and non-parallel process (#​4523)
  • [PHPStan] Merge assert phpstan errors to one (#​4544)
  • [Performance] [Php74] Reduce ClassReflection lookup from property on PropertyTypeChangeGuard (#​4545)
  • Use instanceof check on ClassReflection resolve (#​4547)
  • [Reflection] Reduce Scope pulling on ReflectionResolver (#​4548)
  • [Strict] Skip empty() from param doc on DisallowedEmptyRuleFixerRector (#​4550)
  • Fix space in paths (#​4553)
  • Skip traits in CountOnNullRector (#​4556)
  • Make use of toPhpDocNode() - take #​2 (#​4555)
  • [Performance] [PostRector] Only check phpdocinfo on Stmt and Param on NameImportingPostRector (#​4558)
  • [CodeQuality] Skip pull property from inner class on CompleteDynamicPropertiesRector (#​4561)
  • Prevent unnecessary scope creation (#​4562), Thanks @​staabm!
  • NameImportingPhpDocNodeVisitor: Cheap checks first (#​4563), Thanks @​staabm!
  • [Performance][Renaming] No need PhpDocInfo refactor on Name node on ClassRenamer (#​4566)
  • [TypeDeclaration] Deprecate ArrayShapeFromConstantArrayReturnRector as uses docblocks that we move away from since 0.15 (#​4571)
  • Make ReturnTypeFromStrictNewArrayRector handle only single level arrays (#​4575)
  • Fix array mapping (#​4576)
  • [Performance] [PostRector] Reduce repetitive resolve uses statements on NameImportingPostRector (#​4579)
  • [EarlyReturn] Handle multiple statements in else in ChangeIfElseValueAssignToEarlyReturnRector (#​4580), Thanks @​dorrogeray!
  • [BUGFIX] Ensure proper reprint with attributes for finalized classes (#​4585), Thanks @​cngJo!

Removed 💀

  • [DX] Remove AllowEmptyConfigurableRectorInterface to ease interface tree, better handle on particular configure() method inside the rule (#​4540)
  • Skip description on same line, remove on next line as based on phpdoc-parser in RemoveUselessParamTagRector (#​4551)
  • [Performance][PostRector] Remove alias exists check on NameImporter called from NameImportingPostRector (#​4564)
  • [Performance][BetterPhpDocParser] Remove unused ConstExprNode check on ConstExprClassNameDecorator (#​4578)
  • [PHPStanStaticTypeMapper] Remove manual type check on PHPStanStaticTypeMapper (#​4583)
  • [StaticTypeMapper] Remove standalone false handling on StaticTypeMapper (#​4582)

v0.17.6: Released Rector 0.17.6

Compare Source

In this release, we narrowed rules from PHPUit and Doctrine to their specific version category. We've detected few outdated and never used rules and cleaned them up to make Rector smaller and easier to use 👍

Be use to always use *SetList constants over specific rules to use the latest version:

use Rector\Config\RectorConfig;

return static function (RectorConfig $rectorConfig): void {
    $rectorConfig->sets([
        \Rector\PHPUnit\Set\PHPUnitLevelSetList::UP_TO_PHPUNIT_100,
    ]);
};

New Features 🥳

  • Add PHPUnit to sets (#​4495)
  • [CI] Add PHPUnit 10 to check rules and sets groups (#​4500)
  • [CI] Add doctrine rules in set check (#​4505)

Bugfixes 🐛

  • [Performance] Only set Attribute on context inside ArrayDimFetch and ArrayItem on specific node used (#​4493)
  • [Php52] Use instanceof check instead of compare object $newStmt === $caseStmt on ContinueToBreakInSwitchRector (#​4494)
  • Exclude the full docs folder from archives (#​4497), Thanks @​stof!
  • Cleanup RecastingRemovalRector tests (#​4498)
  • Move Rector order test to PHPUnit, as uses its rules (#​4499)
  • let phpunit handle its own empty method rule (#​4501), Thanks @​staabm!
  • Micro optimizations: cheap checks first (#​4510), Thanks @​staabm!
  • Skip coalsce assign in RemoveUnusedPrivatePropertyRector (#​4491)
  • [DeadCode] Skip append += assignment on RemoveUnusedPrivatePropertyRector (#​4506)
  • [AstResolver][Performance] Remove unnecessary double File read on AstResolver::parseFileNameToDecoratedNodes() (#​4508)

Removed 💀

  • [NodeTypeResolver] Remove unused AttributeKey::INSIDE_ARRAY_ITEM on ContextNodeVisitor (#​4496)
  • [NodeTypeResolver] Remove AttributeKey::IS_RETURN_EXPR from ContextNodeVisitor (#​4502)
  • [NodeTypeResolver] Remove AttributeKey::IS_ISSET_VAR from ContextNodeVisitor (#​4503)
  • [NodeTypeResolver] Remove nestedChainMethodCallLimit() for deep method call counter check (#​4504)

v0.17.5: Released Rector 0.17.5

Compare Source

Removed 💀

  • [DeadCode] Skip property not exists on RemoveTypedPropertyDeadInstanceOfRector (#​4481)
  • [CodeQuality][Php80] Handle infite loop swap params on RemoveUnusedVariableInCatchRector + OptionalParametersAfterRequiredRector (#​4484)

Bugfixes 🐛

  • fix(rules): Skip readonly classes from restoring default null value. (#​4479), Thanks @​scyzoryck!
  • [Php80] Handle crash on ClassOnObjectRector + GetDebugTypeRector (#​4483)
  • [Strict] Fix DisallowedEmptyRuleFixerRector on empty string isset (#​4485)
  • Fix StrictArrayParamDimFetchRector on is_* calls (#​4486), Thanks @​staabm!
  • Fix trait rename in Php4ConsturctorRector (#​4487)
  • Fix StrictArrayParamDimFetchRector on same named property (#​4488), Thanks @​staabm!

v0.17.4: Released Rector 0.17.4

Compare Source

Bugfixes 🐛

  • [CodeQuality][EarlyReturn] Handle crash Replace Stmt to Expr on FlipTypeControlToUseExclusiveTypeRector+FlipTypeControlToUseExclusiveTypeRector+ReturnBinaryOrToEarlyReturnRector (#​4474)
  • Fix ReturnBinaryOrToEarlyReturnRector mixing up returned nodes of array, hook into StmtsAwareInterface instead to keep next Rector rules updated (#​4476)

Removed 💀

  • Remove duplicated version_compare ReplaceFuncCallArgumentDefaultValue rule (#​4473), Thanks @​alexander-schranz!
  • [EarlyReturn] Remove ReturnBinaryAndToEarlyReturnRector as creates code hard to read and flips condition (#​4478)

v0.17.3: Released Rector 0.17.3

Compare Source

In this release we continue preparing for Rector 1.0 release #​7854

This includes removing last parent node connections, to lower node tree memory consumption 🥳🥳🥳

  • [EarlyReturn] Remove findFirstNext() on InvertedIfFactory (#​4399)
  • [DX] Remove findParentType() method (#​4438)
  • [DX] Remove parent node from AbstractRector (#​4465)

New Features 🥳

  • Add float mul integer type to NumericReturnTypeFromStrictScalarReturnsRector (#​4376)
  • [TypeDeclaration] Add Encapsed string support to AlwaysStrictScalarExprAnalyzer (#​4382)
  • [TypeDeclaration] Add StrictArrayParamDimFetchRector (#​4384)
  • [DX] Kick of SimpleParameterProvider (#​4405)

Bugfixes 🐛

  • [DeadCode] Skip non typed param numeric check on RecastingRemovalRector (#​4390)
  • [Renaming] Handle crash on catch Exception name on RenameClassRector (#​4401)
  • Fix NumericReturnTypeFromStrictScalarReturnsRector for non-natively-typed parameters (#​4380), Thanks @​staabm!
  • [Php82] Skip extends unknown class on ReadonlyClassRector (#​4408)
  • [TypeDeclaration] Handle crash on no namespace with + operation on DeclareStrictTypesRector (#​4414)
  • [NodeTypeResolver] Reduce duplicated Scope fill on FuncCall (#​4428)
  • Make JsonThrowOnErrorRector work with local scope to detect error_json methods (#​4451)
  • Deprecate resolveNextNode() to work only in current node tree context (#​4455)
  • [Naming] Skip used on next foreach on RenameForeachValueVariableToMatchExprVariableRector (#​4469)

Removed 💀

  • Remove duplicate ReturnNeverTypeRector rule (#​4381), Thanks @​buffcode!
  • [MysqlToMysqli] Deprecate set, as dangerous to use, better handle manually (#​4448)
  • [DX] Make use of SimpleParameterProvider directly, deprecate RectorConfigProvider (#​4460)
  • [Performance] Immediate remove UnreachableStatementNodeVisitor object after traverse to avoid re-use in next file (#​4417)
  • [NodeTypeResolver] Remove ArrayItem scope filling from Array_ and Name filling for Catch types on PHPStanNodeScopeResolver (#​4423)
  • [PHP 8] Resources object upgrade - remove 2 rules as the upgrade require wholesome manual work (#​4442)
  • [DeadCode] Remove RemoveJustVariableAssignRector as often done on purpose or with side effect (#​4450)
  • Remove deprecated resolveNextNode() to embrace local scope node (#​4456)
  • [DX] Remove node connecting traverser from AbstractRector (#​4463)
  • Remove NodeConnectingTraverser (#​4464)
  • [DX] Remove autowrapping of expr/stmt to make return values in the same type and reliable (#​4466)

v0.17.2: Released Rector 0.17.2

Compare Source

In this release we continue preparing for Rector 1.0 release #​7854

This includes:

  • removing more parent node connections, to lower node tree memory consumption

New Features 🥳

  • Add sleep after processPool->quitAll() to give time for all child processes to terminate (#​4280), Thanks @​dorrogeray!
  • [TypeDeclaration] Add NumericReturnTypeFromStrictScalarReturnsRector (#​4296)
  • [Php71] Add Closure support on AssignArrayToStringRector (#​4303)
  • Introduces AddSensitiveParameterAttributeRector rule (#​4342), Thanks @​peterfox!
  • Bump nikic/php-parser to 4.16.0 (#​4343)
  • Show error when no files will be processed (#​4326), Thanks @​staabm!
  • Cache unchanged files on dry run v2 (#​4281), Thanks @​dorrogeray!

Bugfixes 🐛

  • [CodeQuality] Handle crash on variable variable on OptionalParametersAfterRequiredRector (#​4226)
  • Fix LocallyCalledStaticMethodToNonStaticRector with method args (#​4233), Thanks @​toastedghost!
  • Use FunctionLike contract instead of union of function-like concrete implementations (#​4241), Thanks @​Wirone!
  • [CodeQuality][Performance] Reduce repetitive NodeTypeResolver->getType() on ExprBoolCaster (#​4279)
  • Skip rewindable generator (#​4282)
  • [Php55][NodeTypeResolver] Handle crash on dynamic variable concat assign on StringClassNameToClassConstantRector (#​4283)
  • [Php55] Clean up FullyQualified assigned to FullyQualified on StringClassNameToClassConstantRector (#​4284)
  • [TypeDeclaration] Extend NumericReturnTypeFromStrictScalarReturnsRector (#​4297)
  • Skip divide in NumericReturnTypeFromStrictScalarReturnsRector (#​4298)
  • [TypeDeclaration] Skip once typed and else return array_map() on ReturnTypeFromStrictTypedCallRector (#​4312)
  • Fix command to configure rector (#​4314), Thanks @​bertramakers!
  • [Performance] [NodeTypeResolver] Reduce callable traverse usage on ContextNodeVisitor (#​4317)
  • [CodeQuality] Skip not regex on SimplifyRegexPatternRector (#​4322)
  • [TypeDeclaration] Handle crash on object shape on ArrayShapeFromConstantArrayReturnRector (#​4323)
  • [Php81] Skip named constructor on ReadOnlyPropertyRector (#​4359)
  • Skip argument if value equals default value (#​4368), Thanks @​stefantalen!
  • [MysqlToMysqli] Handle infinite loop on MysqlQueryMysqlErrorWithLinkRector when no connection instance on first dept stmt (#​4375)

Removed 💀

  • Remove removeNode() method from AbstractRector (#​4225)
  • Remove Kind from doc mapper, as used just once (#​4234)
  • Move LocallyCalledStaticMethodToNonStaticRector to CodeQuality namespace, to avoid dumping removed static set (#​4242)
  • Restore RemoveMethodCallParamRector as used (#​4244)
  • [Performance] Remove NODES_TO_MATCH constant on RemoveNonExistingVarAnnotationRector (#​4267)
  • Remove VarConstantCommentRector as using unreliable docblocks, better use upcoming PHP 8.3 strict type const (#​4307)
  • [Naming] Remove BreakingVariableRenameGuard::isUsedInIfAndOtherBranches() to remove previous by types (#​4319)
  • [Php81] Remove cast check on NullToStrictStringFuncCallArgRector (#​4320)
  • [PhpParser] Remove BetterNodeFinder::findFirstPreviousOfTypes() (#​4327)
  • Move AddMethodParentCallRector to Symfony Rector (#​4301)

v0.17.1: Released Rector 0.17.1

Compare Source

In this release we continue preparing for Rector 1.0 release #​7854

This includes:

  • removing more parent node connections, to lower node tree memory consumption
  • replacing removeNode() method with return NodeTraverser::REMOVE_NODE direct constant to make changes happen directly in the Rector rule
  • refactoring node adding from post-process to directly in the rule

New Features 🥳

  • [Docblock] Move DocBlockUpdater service usage from AbstractRector to PhpDocTypeChanger (#​4215)
  • Improve string support in Doctrine Annotations (#​3645), Thanks @​yguedidi!
  • [Php80] Fix add default nullable type on ClassPropertyAssignToConstructorPromotionRector (#​4091)
  • Add STRICT_BOOLEANS set (#​4116)

Changes

  • [FileProcessor] Add warning instead of skip InlineHTML on PhpFileProcessor (#​4058)
  • Remove node adding collector (#​4095)
  • Remove propperty to add collector, add them directly or as a constructor dependency (#​4131)
  • Move ReturnArrayClassMethodToYieldRector to PHPUnit Rector (#​4213)

Bugfixes 🐛

  • [CodeQuality] Exclude first class callable from IntvalToTypeCastRector (#​7962) (#​4040), Thanks @​thbley!
  • [CodingStyle] Skip first class callable on UnSpreadOperatorRector (#​4041)
  • Skip StrvalToType for strval first class callable syntax (#​4046), Thanks @​NicoImparfait!
  • Ensure check isFirstClassCallable() before node->getArgs() on CallLike (#​4049)
  • [CodeQuality] Skip multiple assigns append before foreach on ForeachItemsAssignToEmptyArrayToAssignRector (#​4052)
  • [CodeQuality] Skip deep append in if foreach before on ForeachItemsAssignToEmptyArrayToAssignRector (#​4053)
  • [NodeTypeResolver] Handle crash after next exit() on no namespaced code after removal next attribute (#​4074)
  • [FileProcessor] Show warning on has InlineHTML node if file has changed on PhpFileProcessor (#​4079)
  • Make SimplifyRegexPatternRector work without parent nodes + deprecate BetterNodeFinder and findParent* methods (#​4105)
  • Fix StaticCallOnNonStaticToInstanceCallRector to skip parent's parent's method calls. (#​4098), Thanks @​klimslim!
  • [CodingStyle] Skip countable object on CountArrayToEmptyArrayComparisonRector (#​4108)
  • [DeadCode] Skip used on Closure use next stmt on RemoveUnusedVariableAssignRector (#​4042)
  • [CodeQuality] Handle throw after if on ConsecutiveNullCompareReturnsToNullCoalesceQueueRector (#​4107)
  • [CodeQuality] Handle return new object and no return on ConsecutiveNullCompareReturnsToNullCoalesceQueueRector (#​4112)
  • Make ConvertStaticPrivateConstantToSelfRector work for non-final classes, make part of code-quality set (#​4114)
  • StringClassNameToClassConstantRector: cheap checks first (#​4151), Thanks @​staabm!
  • Reduce memory-consumption by simpler skip-patterns (#​4152), Thanks @​staabm!
  • Skipping: Use plain string functions instead of regex matching (#​4153), Thanks @​staabm!
  • Split instance of check to 2 rules (#​4165)
  • Performance: Prevent sorting of files in PhpFilesFinder (#​4164), Thanks @​staabm!
  • Move PreferThisOrSelfMethodCallRector to PHPUnit rector package, to handle exact cases (#​4194)
  • [Renaming] Handle crash in trait use on RenameClassRector (#​4196)
  • [Php56] Handle infinite loop on big array method call on AddDefaultValueForUndefinedVariableRector (#​4142)
  • [Php56] Skip variable variable on AddDefaultValueForUndefinedVariableRector (#​4148)

Removed 💀

  • [DeadCode] Remove removeNode() from RemoveDeadReturnRector, merge RemoveLastReturnRector to RemoveDeadReturnRector (#​4085)
  • [PHP+HTML cleanup] Remove MixPhpHtmlDecorator (#​4054)
  • Remove HTML + PHP support, as must be handled in php-parser first (#​4051)
  • Remove MultipleClassFileToPsr4ClassesRector as only PSR4 rule, bit risky and better handled with PHPStan + remove adding/removing files logic, use printer instead (#​4117)
  • Remove NormalizeNamespaceByPSR4ComposerAutoloadRector as only moves files to namespaces, does not update any class referenes; better use IDE here (#​4057)
  • Remove MultipleClassFileToPsr4ClassesRector as only PSR4 rule, bit risky and better handled with PHPStan + remove adding/removing files logic, use printer instead (#​4117)
  • Remove AttributeCompatibleAnnotationRector, as only for one-time migration of private project, not suitable for general use (#​4064)
  • Remove RemoveAlwaysTrueConditionSetInConstructor, as overly specific and not practical; better handle with PHPStan (#​4065)
  • Remove deprecated UnionTypesRector and NarrowUnionTypeDocRector, use strict-based rules from TypeDeclaration set instead (#​4069)
  • Remove TargetRemoveClassMethodRector, as IDE specific (#​4076)
  • Remove ArrayKeysAndInArrayToArrayKeyExistsRector as narrow, does not check variable usage and might be on purpose (#​4084)
  • Remove ChangeGlobalVariablesToPropertiesRector as the scope might change after the variable is defined, better handle with PHPStan (#​4086)
  • Remove NewToConstructorInjectionRector as unused and only for demo purposes (#​4087)
  • [NodeTraverser] Remove double apply FileWithoutNamespace, remove recursive lookup stmts on BetterStandardPrinter (#​4097)
  • Remove ActionInjectionToConstructorInjectionRector as rather for demo purposes, not practical (#​4113)
  • Remove ConstantListClassToEnumRector as custom-made, not practical for enum upgrades (#​4115)
  • Remove RemoveMethodCallParamRector, as unused (#​4119)
  • Remove RemoveAllowDynamicPropertiesAttributeRector as attribute is a comment on lower PHP versions, also rather downgrade rule (#​4120)
  • Remove DoctrineAnnotationClassToAttributeRector as made for custom project, not useful for general use (#​4127)
  • Remove UnsetAndIssetToMethodCallRector as unused (#​4123)
  • Remove MethodCallToMethodCallRector as unused (#​4128)
  • Remove NewArgToMethodCallRector as unused (#​4130)
  • Remove RemoveDelegatingParentCallRector as overly complex and usually on purpose (#​4136)
  • Remove RemoveEmptyMethodCallRector as better handled by PHPStan (#​4161)
  • Remove BetterNodeFinder::findLastInstanceOf() as unused + make resolvePreviousNode() private, as used only locally (#​4195)
  • [DeadCode] Remove Assign and AssignRef as node types on RemoveNonExistingVarAnnotationRector (#​4209)

v0.17.0: Released Rector 0.17

Compare Source

Preparing for Rector 1.0

In this release, we focus on architecture improvements before reaching Rector 1.0. We want to lower the memory usage and make Rector run faster.

This include removing next/previous nodes - this will most likely not affect you, as Rector rules were upgraded, but if you do you use them, switch to StmtsAwareInterface instead

We follow PHPStan 1.6 move from April 2022, where you can learn more: https://phpstan.org/blog/preprocessing-ast-for-custom-rules

  • Replace NodeConnectingVisitor with ParentConnectingVisitor (#​3900)

To see how to refactor to StmtsAwareInterface, check these PRs:

  • Remove NEXT_NODE dependency in ChangeAndIfToEarlyReturnRector, narrow to only closed scope function likes (#​3913)
  • Remove NEXT_NODE from SimplifyIfReturnBoolRector (#​3915)
  • [DeadCode] Remove next attribute on RemoveUnusedVariableAssignRector ([#​3917](https://github.com/rectorphp/
  • [CodingStyle] Refactor CatchExceptionNameMatchingTypeRector to use StmtsAwareInterface (#​3788)

Add/remove nodes directly 👍

The next improvement focuses on explicit node adding/removal. Thanks to StmtsAwareInterface we can add nodes directly. This makes Rector refactor() method contain all the code you need.

  • Cleanup usage of NodesToAddCollector, return nodes directly instead (#​4003)
  • Cleanup removeNodeFromStatements(), removeArg(), removeParam(), removeStmt() methods and remove nodes directly (#​4012)
  • Remove unused addNodeAfterNode(), return nodes instead (#​4023)
  • Remove unused method addNodesBeforeNode() (#​4024)

New Features 🥳

  • [PHP 7.0] Add IfIssetToCoalescingRector (#​3878)
  • Support attributes in RemoveFinalFromEntityRector (#​3727), Thanks @​alexndlm!
  • Add SwapMethodCallArgumentsRector (#​3726), Thanks @​gaydamakha!
  • [CodeQuality] Add CleanupUnneededNullsafeOperatorRector (#​3767)
  • Make ReturnNeverTypeRector work with type declaration, add it to PHP 8.1 set (#​3852)
  • [TypeDeclaration] Add BoolReturnTypeFromStrictScalarReturnsRector (#​3898)
  • Make ChangeGlobalVariablesToPropertiesRector add properties directly, remove Nette inject methods (#​3957)
  • Utilize MinPhpVersionInterface in more rules (#​3752), Thanks @​staabm!
  • Dump dependency container and re-use it - 35% faster test-suite (#​3809), Thanks @​staabm!
  • Defer type-resolving in RemoveJustPropertyFetchRector (#​3761), Thanks @​staabm!

Bugfixes 🐛

  • [TypeDeclaration] Skip Arg unpack on AddMethodCallBasedStrictParamTypeRector (#​3787)
  • [CodeQuality] Add typed property support to IssetOnPropertyObjectToPropertyExistsRector (#​3876)
  • [CodeQuality] Skip non-array type on SimplifyForeachToArrayFilterRector (#​3738)
  • Fix ShortenedObjectType not resolving to correct class reflection (#​3397), Thanks @​jackbentley!
  • Extend code-quality set (#​3773)
  • Don't neon-decode phpstan configs over and over again (#​3796), Thanks @​staabm!
  • [Console] Allow https url instead of git:// on SetupCICommand (#​3799)
  • Fix integer range phpdoc types being treated as useless (#​3825), Thanks @​jlherren!
  • Fix nullable param in ClassPropertyAssignToConstructorPromotionRector (#​3842)
  • Fix PrivatesAccessor: use selectFromArgs() instead (#​3923), Thanks @​staabm!

Removed rules 💀

We've also remove bunch of rules, that were added in early days of Rector for demo purposes. They were not used as of any set for non-reliable cases. PHPStan and coding standards replace some of those.

  • [CodeQuality] Remove ForToForeachRector, as overly deatiled and not reliable (#​3747)
  • [CodeQuality] Remove SimplifyIfExactValueReturnValueRector, as overly defensive + InlineSimplePropertyAnnotationRector as purely coding standard area (#​3764)
  • [CodingStyle] Remove RemoveDoubleUnderscoreInMethodNameRector, as naming is not handled for breaking reasons (#​3765)
  • Remove RemoveUnusedVariableAssignRector, as could be breaking code in order of excution and hard to do reliable (#​3793)
  • [CodingStyle] Remove ConsistentPregDelimiterRector as not much practical, importance of regex is a testing it matches expectationg, area of static analysis (#​3797)
  • Remove ToStringToMethodCallRector as not practical and only for demo, FalseReturnClassMethodToNullableRector, as requires detailed custom refactoring (#​3854)
  • Remove ChangeOrIfReturnToEarlyReturnRector as makes code harder to read by duplication, rather use PHSPtan and extract method (#​3916)
  • [DeadCode] Remove RemoveDuplicatedIfReturnRector as can lead to unexpeced consequences, better use static analysis and contextual handling (#​3926)
  • [DeadCode] Remove RemoveDuplicatedInstanceOfRector as hardly practical (#​3936)
  • [CodeQuality] Remove ExplicitMethodCallOverMagicGetSetRector designed for nette smart object migration only, not useful for general projects (#​3948)
  • Remove GetAndSetToMethodCallRector, as not practical and used for single legacy job (#​3953)
  • Remove ChangeReadOnlyVariableWithDefaultValueToConstantRector overly complex and risky, better job for PHPStan (#​3954)
  • Remove IsObjectOnIncompleteClassRector as blindly turns all incomplete checks to negated, better examine manually (#​3969)
  • Remove ReservedObjectRector as requires explicit configuration and is handled by RenameClassRector already (#​3975)
  • Remove ChangeReadOnlyPropertyWithDefaultValueToConstantRector as overly detailed checks, better use PHPStan and refactor individually (#​4028)
  • Remove NewToMethodCallRector as unused core and no other extension, niche to use, better handle by PHPStorm (#​4029)
  • [CodingStyle] Remove AddFalseDefaultToBoolPropertyRector, as works with unrelaible docblocks (#​3856)
  • Remove UpdateFileNameByClassNameFileSystemRector niche rule that was added just for example sake (#​3849)
  • [Transform] Remove ArgumentFuncCallToMethodCallRector as never used (#​3774)
  • [Transform] Remove DimFetchAssignToMethodCallRector as unused (#​3775)
  • [Transform] Remove FileGetContentsAndJsonDecodeToStaticCallRector as only for demo purposes (#​3776)
  • [Transform] Remove MethodCallToAnotherMethodCallWithArgumentsRector as unused (#​3777)
  • [CodeQuality] Remove SimplifyUselessLastVariableAssignRector as overly complex and should be handled individually (#​3784)
  • Remove AddPregQuoteDelimiterRector as very narrow area and has not context awareness, better handle manually (#​3927)
  • Remove TokenGetAllToObjectRector, as rare to use and leaky to handle, better handle in controller manual way (#​4001)
  • Remove ChangeReflectionTypeToStringToGetNameRector as niche and overly detailed, better refactor reflectio na as a whole (#​3976)
  • Remove RenameNamespaceRector, better handle by IDE or explicit RenameClassRector (#​3979)
  • [CodeQuality] Deprecate NarrowUnionTypeDocRector as focused on docblocks, and moving to type declarations (#​3848)
  • Remove MakeTypedPropertyNullableIfCheckedRector as old fix of TypedPropertyRector rule, removed months ago (#​3851)
  • [PHP 8.0] Deprecate old UnionTypesRector that is dangerously moving docblocks, use type declaration rules instead (#​3846)
  • [CodingStyle] Remove OrderAttributesRector, as rather coding standard and does not have specific PSR example (#​3838)
  • Remove unused PregMatchTypeCorrector, the 3rd param in preg_match_* is now handled natively by PHPStan (#​3824)
  • [Restoration] Remove RemoveFinalFromEntityRector as used only to revert very old Rector bug (#​3847)

v0.16.0: Released Rector 0.16.0

Compare Source

New Features 🥳

  • [TypeDeclaration] Add WhileNullableToInstanceofRector (#​3680)

Bugfixes 🐛

  • Fix SingleInArrayToCompareRector if array item is variadic (#​3640), Thanks @​raoz!
  • [Php80] Handle crash leaveNode() returned invalid value of type integer on TokenGetAllToObjectRector (#​3644)
  • [TypeDeclaration] Handle mix InlineHTML on FileWithoutNamespace (#​3648)
  • Simplify PhpFilesFinder (#​3649), Thanks @​staabm!
  • [Test] Rename fixture and refactor to solve random error (#​3677)
  • [TypeDeclaration] Refactor UnionTypeMapper::narrowBoolType() to allow bool|int|false converted to bool|int (#​3685)
  • Update phpdoc-parser to ^1.20.3 (#​3691)
  • [Privatization] Skip variable assign append on ChangeReadOnlyVariableWithDefaultValueToConstantRector (#​3687), Thanks @​mickeytodd!
  • [NodeManipulator] clean up multiple instanceof check on AssignManipulator (#​3695)
  • [CodeQuality] Using local variable $hasChanged on NarrowUnionTypeDocRector (#​3697)
  • Cache on successful file processing (#​3614), Thanks @​yguedidi!
  • [CodingStyle] Skip concat on first arg on ConsistentImplodeRector (#​3702), Thanks @​nerones!
  • Fix ExplicitMethodCallOverMagicGetSetRector with a protected method (#​3732), Thanks @​pierredup!
  • [TypeDeclaration] Handle infinite loop on array_reverse with index on AddMethodCallBasedStrictParamTypeRector on php8+ feature (#​3678)
  • [TypeDeclaration] Handle regression multiple params no longer working on AddMethodCallBasedStrictParamTypeRector (#​3681)
  • [TypeDeclaration] Add do { } while support on WhileNullableToInstanceofRector (#​3682)
  • [Php56][Php70][Php74] Handle infinite loop on AddDefaultValueForUndefinedVariableRector+IfToSpaceshipRector+ClosureToArrowFunctionRector (#​3701)

Performance Improvements 🚀

  • [Performance] Using findFirst() for cast to (bool) so no need search all found nodes (#​3642)
  • [Performance] Using cheap chekc first on UndefinedVariableResolver::shouldSkipVariable() (#​3643)
  • [CodeQuality] Improve SimplifyIfElseToTernaryRector performance (#​3721)
  • [Renaming] Prevent overly greed type resolving in RenamePropertyRector (#​3700), Thanks @​staabm!
  • Don't calculate diffs when --no-diffs is given (#​3710), Thanks @​staabm!
  • Calculate diff only once per file after refactoring (#​3711), Thanks @​staabm!
  • Improve PropertyFetchAnalyzer performance (#​3654), Thanks @​staabm!
  • Improve LocalMethodCallFinder performance (#​3651), Thanks @​staabm!
  • Improve LocalConstantFinder performance (#​3652), Thanks @​staabm!
  • Improve NodeComparator performance (#​3659), Thanks @​staabm!
  • Improve ReflectionResolver performance (#​3658), Thanks @​staabm!
  • Improve ParentClassMethodTypeOverrideGuard performance (#​3660), Thanks @​staabm!
  • [PHPStanStaticTypeMapper] Improve UnionTypeMapper performance (#​3686)
  • [PHPStanStaticTypeMapper] Improve UnionTypeMapper performance take 2 (rectorphp/rector-src@931e6e2)
  • [PHPStanStaticTypeMapper] Improve performance of UnionTypeMapper take 3 (#​3690)
  • [Renaming] Improve performance of RenameFunctionRector (#​3699)
  • Add e2e tests for consecutive changing runs (#​3666), Thanks @​yguedidi!
  • [Renaming] Improve performance of RenamePropertyRector (#​3698)
  • [Naming] Improve performance by using findFirst() for casted to (bool) on BreakingVariableRenameGuard (#​3703)
  • [PostRector] Improve performance NameImportingPostRector (#​3708)
  • [Ast] Improve AstResolver and ClassLikeAstResolver performance (#​3714)
  • [NodeManipulator] Improve IfManipulator::collectNestedIfsWithNonBreaking() performance (#​3720)
  • Prevent unnecessary IO in ChangedFilesDetector (#​3650), Thanks @​staabm!
  • [BetterPhpDocParser] Simplify BetterTokenIterator (#​3656), Thanks @​staabm!
  • [Skipper] Prevent unnecessary IO (#​3664), Thanks @​staabm!
  • NodeTypeResolver: prevent unncessary reflection calls (#​3647), Thanks @​staabm!

v0.15.25

Compare Source


Configuration

📅 Schedule: Branch creation - "after 3am every weekday,every weekend" in timezone Europe/Amsterdam, Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [rector/rector](https://getrector.com/) ([source](https://github.com/rectorphp/rector)) | `^0.15.24` → `^0.19.0` | ![age](https://developer.mend.io/api/mc/badges/age/packagist/rector%2frector/0.19.8?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/packagist/rector%2frector/0.15.24/0.19.8?slim=true) | --- ### Release Notes <details> <summary>rectorphp/rector (rector/rector)</summary> ### [`v0.19.8`](https://github.com/rectorphp/rector/releases/tag/0.19.8): Released Rector 0.19.8 [Compare Source](https://github.com/rectorphp/rector/compare/0.19.7...0.19.8) #### New Features :partying\_face: - \[experimental] Add withTypeCoverageLevel() method to streamline Rector integration to new projects ([#&#8203;5553](https://github.com/rectorphp/rector-src/pull/5553)) <br> #### Bugfixes :bug: - Cache null result on ProjectComposerJsonPhpVersionResolver ([#&#8203;5559](https://github.com/rectorphp/rector-src/pull/5559)) - Real fix paths The given paths do not match any files on RectorConfigBuilder ([#&#8203;5561](https://github.com/rectorphp/rector-src/pull/5561)) ### [`v0.19.7`](https://github.com/rectorphp/rector/releases/tag/0.19.7): Released Rector 0.19.7 [Compare Source](https://github.com/rectorphp/rector/compare/0.19.6...0.19.7) #### Bugfixes :bug: - \[TypeDeclaration] Skip assign in construct with method call property same name on RestoreDefaultNullToNullableTypePropertyRector ([#&#8203;5556](https://github.com/rectorphp/rector-src/pull/5556)) - \[Privatization] Fix reprint with attribute on FinalizeTestCaseClassRector ([#&#8203;5557](https://github.com/rectorphp/rector-src/pull/5557)) - \[DX] Fix missing Rector\RectorGenerator\Exception\ConfigurationException ([#&#8203;5558](https://github.com/rectorphp/rector-src/pull/5558)) - Fix platform version resolution, use require first ([#&#8203;5555](https://github.com/rectorphp/rector-src/pull/5555)) - bump template version ([rectorphp/rector-src@`02a088c`](https://github.com/rectorphp/rector-src/commit/02a088c735b9b829c8f0dec445e71dea70e559bc)) ### [`v0.19.6`](https://github.com/rectorphp/rector/releases/tag/0.19.6): Released Rector 0.19.6 [Compare Source](https://github.com/rectorphp/rector/compare/0.19.5...0.19.6) #### New Features and Changes :partying\_face: - \[EarlyReturn] Improve RemoveAlwaysElseRector to handle multiple ElseIfs ([#&#8203;8178](https://github.com/rectorphp/rector/issues/8178)) ([#&#8203;5521](https://github.com/rectorphp/rector-src/pull/5521)), Thanks [@&#8203;pkvach](https://github.com/pkvach)! - \[Privatization] Add FinalizeTestCaseClassRector ([#&#8203;5539](https://github.com/rectorphp/rector-src/pull/5539)) - Add support for YieldFrom into places where Yield\_ is checked ([#&#8203;5499](https://github.com/rectorphp/rector-src/pull/5499)), Thanks [@&#8203;integer](https://github.com/integer)! - \[Transform] Add RectorConfigBuilderRector ([#&#8203;5551](https://github.com/rectorphp/rector-src/pull/5551)) - \[DX] Warn about run on /vendor directory ([#&#8203;5525](https://github.com/rectorphp/rector-src/pull/5525)) - \[DX] PHP sets should not disable all other version-based rules ([#&#8203;5527](https://github.com/rectorphp/rector-src/pull/5527)) - **\[stabilize] Deprecate FinalizeClassesWithoutChildrenRector as causing bugs without full context ([#&#8203;5535](https://github.com/rectorphp/rector-src/pull/5535))** <br> #### Bugfixes :bug: - **Fix xdebug handling ([#&#8203;5544](https://github.com/rectorphp/rector-src/pull/5544)), Thanks [@&#8203;staabm](https://github.com/staabm)!** - Added 4 methods into RectorConfigBuilder ([#&#8203;5524](https://github.com/rectorphp/rector-src/pull/5524)), Thanks [@&#8203;Perf](https://github.com/Perf)! - Fix AddMethodCallBasedStrictParamTypeRector if already has a type ([#&#8203;5530](https://github.com/rectorphp/rector-src/pull/5530)) - \[CodingStyle] Return null on no change on StrictArraySearchRector ([#&#8203;5528](https://github.com/rectorphp/rector-src/pull/5528)) - \[Php81] Allow nullable union on NullToStrictStringFuncCallArgRector ([#&#8203;5532](https://github.com/rectorphp/rector-src/pull/5532)) - \[stabilize] Deprecate FinalizePublicClassConstantRector as not reliable and causes uncontroller changed ([#&#8203;5534](https://github.com/rectorphp/rector-src/pull/5534)) - \[TypeDeclaration] Change bool to false or true docblock when union has false/true standalone type on ReturnUnionTypeRector ([#&#8203;5543](https://github.com/rectorphp/rector-src/pull/5543)) - \[EarlyReturn] Skip append variable in PreparedValueToEarlyReturnRector ([#&#8203;8390](https://github.com/rectorphp/rector/issues/8390)) ([#&#8203;5545](https://github.com/rectorphp/rector-src/pull/5545)), Thanks [@&#8203;pkvach](https://github.com/pkvach)! - Fix make ReadOnlyPropertyRector skip if traits are used, as not reliable ([#&#8203;5548](https://github.com/rectorphp/rector-src/pull/5548)) - Kick off basic rector.php with simpler and more practical rule ([#&#8203;5552](https://github.com/rectorphp/rector-src/pull/5552)) <br> #### Removed :skull: - Exclude finalize rule from private set, to keep safer ([#&#8203;5523](https://github.com/rectorphp/rector-src/pull/5523)) - \[Performance] Remove CollectedData on ProcessResult ([#&#8203;5520](https://github.com/rectorphp/rector-src/pull/5520)) - \[stabilize] Remove family tree check from ClassMethodParamVendorLockResolver as not reliable ([#&#8203;5536](https://github.com/rectorphp/rector-src/pull/5536)) - \[stabilize] Remove child classes from MixedTypeRector as not reliable ([#&#8203;5537](https://github.com/rectorphp/rector-src/pull/5537)) - \[stabilize] Remove last children method checks ([#&#8203;5538](https://github.com/rectorphp/rector-src/pull/5538)) ### [`v0.19.5`](https://github.com/rectorphp/rector/releases/tag/0.19.5): Released Rector 0.19.5 [Compare Source](https://github.com/rectorphp/rector/compare/0.19.4...0.19.5) #### New Features :tada: - \[Autoloading] Allow to define bootstrapFiles(\[**DIR** . '/some.phar']) on BootstrapFilesIncluder ([#&#8203;5518](https://github.com/rectorphp/rector-src/pull/5518)) - add withPhpSets() methods ([#&#8203;5519](https://github.com/rectorphp/rector-src/pull/5519)) ### [`v0.19.4`](https://github.com/rectorphp/rector/releases/tag/0.19.4): Released Rector 0.19.4 [Compare Source](https://github.com/rectorphp/rector/compare/0.19.3...0.19.4) #### Bugfixes :bug: - Fix configured rule ([#&#8203;5517](https://github.com/rectorphp/rector-src/pull/5517)) ### [`v0.19.3`](https://github.com/rectorphp/rector/releases/tag/0.19.3): Released Rector 0.19.3 [Compare Source](https://github.com/rectorphp/rector/compare/0.19.2...0.19.3) #### New Features ahd Changes :partying\_face: - **\[Config] Add RectorConfigBuilder ([#&#8203;5503](https://github.com/rectorphp/rector-src/pull/5503))** - Add gitlab to "setup-ci" command ([#&#8203;5497](https://github.com/rectorphp/rector-src/pull/5497)) - **Add "custom-rule" command to make creating rules easy ([#&#8203;5498](https://github.com/rectorphp/rector-src/pull/5498))** - \[Windows] Rework add windows support on tests CI ([#&#8203;5504](https://github.com/rectorphp/rector-src/pull/5504)) - make literal separator optional, as rather coding style and not always desired ([#&#8203;5505](https://github.com/rectorphp/rector-src/pull/5505)) <br> #### Bugfixes :bug: - \[Php70] Skip inside Encapsed on ThisCallOnStaticMethodToStaticCallRector ([#&#8203;5481](https://github.com/rectorphp/rector-src/pull/5481)) - \[Performance] Cache PHP version features on reading composer.json on PhpVersionProvider ([#&#8203;5484](https://github.com/rectorphp/rector-src/pull/5484)) - Fix phpstan ([#&#8203;5489](https://github.com/rectorphp/rector-src/pull/5489)) - \[Config] Restore default values for RectorConfig->parallel() config similar to original <=0.18.x version ([#&#8203;5472](https://github.com/rectorphp/rector-src/pull/5472)) - \[Performance]\[PhpParser] Deprecate InlineCodeParser::parse(), extract into parseFile() and parseString() ([#&#8203;5482](https://github.com/rectorphp/rector-src/pull/5482)) - \[CodeQuality] Skip surplus open square bracket on SimplifyRegexPatternRector ([#&#8203;5494](https://github.com/rectorphp/rector-src/pull/5494)) - \[AutoImport] Skip start with \<?= short open tag on auto import ([#&#8203;5496](https://github.com/rectorphp/rector-src/pull/5496)) - \[Testing] Deprecate FileInfoParser, use existing TestingParser instead ([#&#8203;5501](https://github.com/rectorphp/rector-src/pull/5501)) - custom copy path fix ([#&#8203;5502](https://github.com/rectorphp/rector-src/pull/5502)) - \[DX] Allow Arg in value resolver, as often used and intuitive ([#&#8203;5512](https://github.com/rectorphp/rector-src/pull/5512)) - \[Windows] Support replace \r\n on DocBlockInliner ([#&#8203;5513](https://github.com/rectorphp/rector-src/pull/5513)) - \[Php83] add string type to concat constant ([#&#8203;5516](https://github.com/rectorphp/rector-src/pull/5516)), Thanks [@&#8203;jdohuutin](https://github.com/jdohuutin)! <br> #### Removed :skull: - \[Renaming] Remove namespace renames in ClassRename, as it should only rename references, not move to new namespace ([#&#8203;5487](https://github.com/rectorphp/rector-src/pull/5487)) - \[Renaming] Remove rename class name ([#&#8203;5488](https://github.com/rectorphp/rector-src/pull/5488)) ### [`v0.19.2`](https://github.com/rectorphp/rector/releases/tag/0.19.2): Released Rector 0.19.2 [Compare Source](https://github.com/rectorphp/rector/compare/0.19.1...0.19.2) #### New features and Changes :tada: - \[DX] Depreate heavy and conflicting Symfony/Twig/PHPUnit level sets ([#&#8203;5477](https://github.com/rectorphp/rector-src/pull/5477)) - Remove collectors, as performance very costly and not practically useful ([#&#8203;5470](https://github.com/rectorphp/rector-src/pull/5470)) <br> #### Bugfixes :bug: - **Fix repeated timeouts on CI - [#&#8203;8403](https://github.com/rectorphp/rector/issues/8403), [#&#8203;8396](https://github.com/rectorphp/rector/issues/8396)** - Bump PHPStan to 1.10.56 ([#&#8203;5471](https://github.com/rectorphp/rector-src/pull/5471)) - Remove collector interface and fix SpatieEnumClassToEnumRector already has underscore to double underscore ([#&#8203;5473](https://github.com/rectorphp/rector-src/pull/5473)) - \[DX] Depreate heavy and conflicting Symfony/Twig/PHPUnit level sets ([#&#8203;5477](https://github.com/rectorphp/rector-src/pull/5477)) <br> #### Removed :skull: - \[Performance] Remove unused AttributeKey::ARGUMENT\_POSITION ([#&#8203;5469](https://github.com/rectorphp/rector-src/pull/5469)) - \[Autoload] Remove src/core\_namespace\_aliases.php ([#&#8203;5476](https://github.com/rectorphp/rector-src/pull/5476)) ### [`v0.19.1`](https://github.com/rectorphp/rector/compare/0.19.0...0.19.1) [Compare Source](https://github.com/rectorphp/rector/compare/0.19.0...0.19.1) ### [`v0.19.0`](https://github.com/rectorphp/rector/releases/tag/0.19.0): Released Rector 0.19.0 [Compare Source](https://github.com/rectorphp/rector/compare/0.18.13...0.19.0) In this release we merged 2 directories into `/src` to speed up class loading and make work with code easier. This leads to BC change in namespace for your custom rules: ```diff -use Rector\Core\ +use Rector\ ``` That's it! #### New Features :partying\_face: - \[psr-4] Move /packages directory to /src under single Rector\ namespace ([#&#8203;5414](https://github.com/rectorphp/rector-src/pull/5414)) - \[Arguments] Allow no default value on ArgumentAdderRector ([#&#8203;5382](https://github.com/rectorphp/rector-src/pull/5382)) - **Add related polyfill interface to other PHP 8.0/7.3 rules** ([#&#8203;5389](https://github.com/rectorphp/rector-src/pull/5389)) - \[CodingStyle] Add RemoveUselessAliasInUseStatementRector ([#&#8203;5394](https://github.com/rectorphp/rector-src/pull/5394)) - \[Php83] Add CombineHostPortLdapUriRector ([#&#8203;5397](https://github.com/rectorphp/rector-src/pull/5397)) - \[TypeDeclaration] optionally only add types for hard coded return values in `ReturnTypeFromStrictScalarReturnExprRector` ([#&#8203;5364](https://github.com/rectorphp/rector-src/pull/5364)), Thanks [@&#8203;RobertMe](https://github.com/RobertMe)! - Add phpstan native cond types for getName() for nodes that always return a string ([#&#8203;5413](https://github.com/rectorphp/rector-src/pull/5413)) - \[Strict] Add StaticProperty supporton may be unitialized static property on DisallowedEmptyRuleFixerRector ([#&#8203;5428](https://github.com/rectorphp/rector-src/pull/5428)) - \[Php83] Add implements interface support on AddOverrideAttributeToOverriddenMethodsRector ([#&#8203;5429](https://github.com/rectorphp/rector-src/pull/5429)) - \[cs] Make use of new ECS config ([#&#8203;5445](https://github.com/rectorphp/rector-src/pull/5445)) <br> #### Bugfixes :bug: - \[TypeDeclaration] Add false and true in union support on ReturnUnionTypeRector ([#&#8203;5355](https://github.com/rectorphp/rector-src/pull/5355)) - Skip classes without final and exception as possibly invoke child implement in AddVoidReturnTypeWhereNoReturnRector ([#&#8203;5381](https://github.com/rectorphp/rector-src/pull/5381)) - Skip non-final class method with no content in AddVoidReturnTypeWhereNoReturnRector ([#&#8203;5386](https://github.com/rectorphp/rector-src/pull/5386)) - \[TypeDeclaration] Allow add void return type on magic `__invoke()` method on AddVoidReturnTypeWhereNoReturnRector ([#&#8203;5376](https://github.com/rectorphp/rector-src/pull/5376)) - Add `ReturnTypeFromStrictBoolReturnExprRector` support for if/else returns ([#&#8203;5384](https://github.com/rectorphp/rector-src/pull/5384)) - Skip void without final keyword in ReturnNeverTypeRector as could be implemented with more precise children ([#&#8203;5379](https://github.com/rectorphp/rector-src/pull/5379)) - Fix StrictArrayParamDimFetchRector for string access ([#&#8203;5383](https://github.com/rectorphp/rector-src/pull/5383)) - Fix variable to property fetch update in ClassPropertyAssignToConstructorPromotionRector ([#&#8203;5385](https://github.com/rectorphp/rector-src/pull/5385)) - \[Php] Fix filter cache on PolyfillPackagesProvider ([#&#8203;5390](https://github.com/rectorphp/rector-src/pull/5390)) - \[Parallel] Fix missing --xdebug in WorkerCommand line on WorkerCommandLineFactory when --xdebug provided ([#&#8203;5398](https://github.com/rectorphp/rector-src/pull/5398)) - Bump phpstan to 1.10.50 ([#&#8203;5399](https://github.com/rectorphp/rector-src/pull/5399)) - \[Php83] Handle dynamic host and port values on CombineHostPortLdapUriRector ([#&#8203;5401](https://github.com/rectorphp/rector-src/pull/5401)) - \[config] Extract RectorConfigValidator and handle config validation there ([#&#8203;5404](https://github.com/rectorphp/rector-src/pull/5404)) - \[psr-4] Update Rector core test reference ([#&#8203;5410](https://github.com/rectorphp/rector-src/pull/5410)) - \[cleanup] Decouple changelog generator ([#&#8203;5412](https://github.com/rectorphp/rector-src/pull/5412)) - \[Strict] Handle may be unitialized property on DisallowedEmptyRuleFixerRector ([#&#8203;5409](https://github.com/rectorphp/rector-src/pull/5409)) - Bump min. version to PHP 8.2 - readonly classes ([#&#8203;5415](https://github.com/rectorphp/rector-src/pull/5415)) - Decouple LongAndDependentComplexRectorRule to cognitive-complexity package ([#&#8203;5427](https://github.com/rectorphp/rector-src/pull/5427)) - \[TypeDeclaration] Skip with empty() check on StrictArrayParamDimFetchRector ([#&#8203;5432](https://github.com/rectorphp/rector-src/pull/5432)) - \[TypeDeclaration] Allow both integer and string index array on StrictArrayParamDimFetchRector ([#&#8203;5433](https://github.com/rectorphp/rector-src/pull/5433)) - \[TypeDeclaration] Skip re-assign with call and use as arg on StrictArrayParamDimFetchRector ([#&#8203;5434](https://github.com/rectorphp/rector-src/pull/5434)) - \[CodeQuality] Handle crash with call inside loop on SimplifyForeachToCoalescingRector ([#&#8203;5436](https://github.com/rectorphp/rector-src/pull/5436)) - \[TypeDeclaration] Handle with default null on ParamTypeByMethodCallTypeRector ([#&#8203;5437](https://github.com/rectorphp/rector-src/pull/5437)) - \[NodeTypeResolver] Handle crash PHPStan\File\CouldNotReadFileException: Could not read file on IntermediateSourceLocator ([#&#8203;5438](https://github.com/rectorphp/rector-src/pull/5438)) - Allows to convert Spatie enum names to snake upper case ([#&#8203;5435](https://github.com/rectorphp/rector-src/pull/5435)), Thanks [@&#8203;JoolsMcFly](https://github.com/JoolsMcFly)! - fix: RenameMethodRector should handle NullsafeMethodCall ([#&#8203;5444](https://github.com/rectorphp/rector-src/pull/5444)), Thanks [@&#8203;nikophil](https://github.com/nikophil)! - \[Php80]\[CodeQuality] Handle crash on ChangeSwitchToMatchRector + TernaryFalseExpressionToIfRector on under if else ([#&#8203;5446](https://github.com/rectorphp/rector-src/pull/5446)) - Skip cond with side effect in RemoveDeadConditionAboveReturnRector ([#&#8203;5424](https://github.com/rectorphp/rector-src/pull/5424)) - \[DeadCode] Skip nullable array on RemoveUnusedNonEmptyArrayBeforeForeachRector ([#&#8203;5375](https://github.com/rectorphp/rector-src/pull/5375)) - Keep called method in RemoveEmptyClassMethodRector ([#&#8203;5425](https://github.com/rectorphp/rector-src/pull/5425)) <br> #### Removed :skull: - \[DeadCode] Remove RemoveJustPropertyFetchForAssignRector as tailored for single case of private project, not practical for generic use ([#&#8203;5418](https://github.com/rectorphp/rector-src/pull/5418)) - remove array spread from coding style, as often part of personal preference ([rectorphp/rector-src@`a326b85`](https://github.com/rectorphp/rector-src/commit/a326b8504d37093f639245da0b283f588f954890)) ### [`v0.18.13`](https://github.com/rectorphp/rector/releases/tag/0.18.13): Released Rector 0.18.13 [Compare Source](https://github.com/rectorphp/rector/compare/0.18.12...0.18.13) #### New Features :partying\_face: - \[DeadCode] Add Function\_ support on RemoveUselessReturnTagRector ([#&#8203;5325](https://github.com/rectorphp/rector-src/pull/5325)) - \[TypeDeclaration] Add MergeDateTimePropertyTypeDeclarationRector ([#&#8203;5327](https://github.com/rectorphp/rector-src/pull/5327)) - \[DeadCode] Add Function\_ support on RemoveUselessParamTagRector ([#&#8203;5331](https://github.com/rectorphp/rector-src/pull/5331)) - \[DeadCode] Add RemoveNullTagValueNodeRector ([#&#8203;5352](https://github.com/rectorphp/rector-src/pull/5352)) <br> #### Bugfixes :bug: - \[Php83] Fix const from applying incorrect types ([#&#8203;5326](https://github.com/rectorphp/rector-src/pull/5326)), Thanks [@&#8203;peterfox](https://github.com/peterfox)! - \[TypeDeclaration] Fix missing change type to DateTimeInterface on MergeDateTimePropertyTypeDeclarationRector ([#&#8203;5329](https://github.com/rectorphp/rector-src/pull/5329)) - \[TypeDeclaration] Handle DateTimeInterface from use statement on MergeDateTimePropertyTypeDeclarationRector ([#&#8203;5330](https://github.com/rectorphp/rector-src/pull/5330)) - \[TypeDeclaration] Handle assign $this on TypedPropertyFromAssignsRector ([#&#8203;5333](https://github.com/rectorphp/rector-src/pull/5333)) - Fix array type if property is used in TypedPropertyFromStrictConstructorRector ([#&#8203;5339](https://github.com/rectorphp/rector-src/pull/5339)) - \[Naming] Skip DateTimeImmutable on RenamePropertyToMatchTypeRector ([#&#8203;5340](https://github.com/rectorphp/rector-src/pull/5340)) - \[PHP 7.4] Skip typed properties in the set, as standalone set now available ([#&#8203;5342](https://github.com/rectorphp/rector-src/pull/5342)) - \[TypeDeclaration] Skip has child return different type on ReturnNeverTypeRector ([#&#8203;5343](https://github.com/rectorphp/rector-src/pull/5343)) - \[Experiment]\[TypeDeclaration] Allow change abstract class methods with body on ReturnType\*Rector ([#&#8203;5344](https://github.com/rectorphp/rector-src/pull/5344)) - \[Php55] Make StringClassNameToClassConstantRector configurable to keep first pre-backslash string configurable ([#&#8203;5354](https://github.com/rectorphp/rector-src/pull/5354)) - \[TypeDeclaration] Skip casted to (array) on StrictArrayParamDimFetchRector ([#&#8203;5356](https://github.com/rectorphp/rector-src/pull/5356)) - \[TypeDeclaration] Return new static from different object on ReturnTypeFromStrictTypedCallRector ([#&#8203;5357](https://github.com/rectorphp/rector-src/pull/5357)) - \[TypeDeclaration] Allow return static from under function on ReturnTypeFromStrictTypedCallRector ([#&#8203;5358](https://github.com/rectorphp/rector-src/pull/5358)) - \[Naming] Skip `$this` in RenameForeachValueVariableToMatchExprVariableRector ([#&#8203;5360](https://github.com/rectorphp/rector-src/pull/5360)), Thanks [@&#8203;sreichel](https://github.com/sreichel)! - \[Transform] Do not create a new node if the existing node is already the correct one on AttributeKeyToClassConstFetchRector ([#&#8203;5328](https://github.com/rectorphp/rector-src/pull/5328)), Thanks [@&#8203;SerethiX](https://github.com/SerethiX)! - Bump to php parser 4.18 ([#&#8203;5362](https://github.com/rectorphp/rector-src/pull/5362)) - \[CodeQuality] Skip Superglobals variable on SimplifyEmptyCheckOnEmptyArrayRector ([#&#8203;5369](https://github.com/rectorphp/rector-src/pull/5369)) - \[Php55] Handle crash after exit() on GetCalledClassToSelfClassRector ([#&#8203;5372](https://github.com/rectorphp/rector-src/pull/5372)) - \[CodeQuality] Skip method call on else on TernaryFalseExpressionToIfRector ([#&#8203;5373](https://github.com/rectorphp/rector-src/pull/5373)) - Remove return type in case of never in RemoveUselessReturnTagRector ([#&#8203;5323](https://github.com/rectorphp/rector-src/pull/5323)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[DeadCode] Remove unused [@&#8203;return](https://github.com/return) mixed on RemoveUselessReturnTagRector ([#&#8203;5332](https://github.com/rectorphp/rector-src/pull/5332)) - \[DeadCode] Skip has parent class with \_\_call() magic method on RemoveParentCallWithoutParentRector ([#&#8203;5336](https://github.com/rectorphp/rector-src/pull/5336)) - \[PHP 5.5] Remove extra preslash in class reference, as in practice removal manually ([#&#8203;5338](https://github.com/rectorphp/rector-src/pull/5338)) - \[DeadCode] Remove null as never used param type in RemoveUselessParamTagRector ([#&#8203;5348](https://github.com/rectorphp/rector-src/pull/5348)) - **Remove json throw on error rule from PHP 7.3 set, as changed behavior and must be applied on purpose** ([#&#8203;5349](https://github.com/rectorphp/rector-src/pull/5349)) - \[Testing] Remove unnecessary set Parameter Source on TestingParser ([#&#8203;5371](https://github.com/rectorphp/rector-src/pull/5371)) ### [`v0.18.12`](https://github.com/rectorphp/rector/releases/tag/0.18.12): Released Rector 0.18.12 [Compare Source](https://github.com/rectorphp/rector/compare/0.18.11...0.18.12) #### New Features :partying\_face: - \[CodeQuality] Add RemoveUselessIsObjectCheckRector ([#&#8203;5316](https://github.com/rectorphp/rector-src/pull/5316)) - \[PHP83] Implements a rule to add types to class constants ([#&#8203;5290](https://github.com/rectorphp/rector-src/pull/5290)), Thanks [@&#8203;peterfox](https://github.com/peterfox)! <br> #### Bugfixes :bug: - \[TypeDeclaration] Skip iterable already there in AddReturnTypeDeclarationFromYieldsRector ([#&#8203;5291](https://github.com/rectorphp/rector-src/pull/5291)) - \[TypeDeclaration] Remove ParamTypeFromStrictTypedPropertyRector as seems similar feature with AddParamTypeFromPropertyTypeRector ([#&#8203;5293](https://github.com/rectorphp/rector-src/pull/5293)) - \[CodingStyle] Remove AddArrayDefaultToArrayPropertyRector as based on docblock types and public contract, better use type declaration set instad ([#&#8203;5298](https://github.com/rectorphp/rector-src/pull/5298)) - \[TypeDeclaration] Skip return void in abstract empty class in AddVoidReturnTypeWhereNoReturnRector ([#&#8203;5311](https://github.com/rectorphp/rector-src/pull/5311)) - \[Php80] Skip PDO::query() on AddParamBasedOnParentClassMethodRector ([#&#8203;5313](https://github.com/rectorphp/rector-src/pull/5313)) - \[TypeDeclaration] Add If else assign support on TypedPropertyFromAssignsRector ([#&#8203;5314](https://github.com/rectorphp/rector-src/pull/5314)) - \[CodeQuality] Make CommonNotEqualRector skip if not <> ([#&#8203;5292](https://github.com/rectorphp/rector-src/pull/5292)) - \[Naming] Skip singularize "cms" on RenameForeachValueVariableToMatchExprVariableRector ([#&#8203;5294](https://github.com/rectorphp/rector-src/pull/5294)) - \[TypeDeclaration]\[Performance] Check typed param already early on ParamTypeByMethodCallTypeRector ([#&#8203;5295](https://github.com/rectorphp/rector-src/pull/5295)) - \[Strict] Fix DisallowedEmptyRuleFixerRector empty() allow string '0' check ([#&#8203;5296](https://github.com/rectorphp/rector-src/pull/5296)) - \[EarlyReturn] Skip duplicating complex expression in ChangeAndIfToEarlyReturnRector ([#&#8203;5301](https://github.com/rectorphp/rector-src/pull/5301)) - \[Scoped] Exclude symfony/console/Debug/CliRequest.php from parallel-lint PHP 7.2 syntax check ([#&#8203;5304](https://github.com/rectorphp/rector-src/pull/5304)) - Skip RenameMethodRector in never ([#&#8203;5305](https://github.com/rectorphp/rector-src/pull/5305)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[CodeQuality] Skip with else on SimplifyForeachToCoalescingRector ([#&#8203;5307](https://github.com/rectorphp/rector-src/pull/5307)) - \[Doc] Typo fix on sample code documentation on SimplifyForeachToCoalescingRector ([#&#8203;5308](https://github.com/rectorphp/rector-src/pull/5308)) - \[Privatization] Skip call non-private method on non-final class on PrivatizeLocalGetterToPropertyRector ([#&#8203;5309](https://github.com/rectorphp/rector-src/pull/5309)) - \[Privatization] Fix first class callable in PrivatizeLocalGetterToPropertyRector ([#&#8203;5310](https://github.com/rectorphp/rector-src/pull/5310)) - \[TypeDeclaration] Keep constant false return type from strict native call ([#&#8203;5223](https://github.com/rectorphp/rector-src/pull/5223)), Thanks [@&#8203;tomi85](https://github.com/tomi85)! - \[PHP 7.0] Skip mt\_rand() replacement as not valuable ([#&#8203;5315](https://github.com/rectorphp/rector-src/pull/5315)) - \[Strict] Allow check '0' empty zero on BooleanInTernaryOperatorRuleFixerRector on string type ([#&#8203;5297](https://github.com/rectorphp/rector-src/pull/5297)) - Fix annotation to attribute parsing string ([#&#8203;5317](https://github.com/rectorphp/rector-src/pull/5317)) - \[Instanceof] Fix combination of dead instance and compare ([#&#8203;5319](https://github.com/rectorphp/rector-src/pull/5319)) - Remove isPositiveInteger() check for third argument to strpos() ([#&#8203;5257](https://github.com/rectorphp/rector-src/pull/5257)), Thanks [@&#8203;ikari7789](https://github.com/ikari7789)! - Remove return type in case of void in RemoveUselessReturnTagRector ([#&#8203;5318](https://github.com/rectorphp/rector-src/pull/5318)) - \[DeadCode] Skip [@&#8203;return](https://github.com/return) never with void on RemoveUselessReturnTagRector ([#&#8203;5320](https://github.com/rectorphp/rector-src/pull/5320)) - \[DeadCode] Remove useless nullable [@&#8203;return](https://github.com/return) doc on RemoveUselessReturnTagRector ([#&#8203;5321](https://github.com/rectorphp/rector-src/pull/5321)) ### [`v0.18.11`](https://github.com/rectorphp/rector/releases/tag/0.18.11): Released Rector 0.18.11 [Compare Source](https://github.com/rectorphp/rector/compare/0.18.10...0.18.11) #### Bugfixes :bug: - \[DeadCode] Skip multi no stmts on RemoveDuplicatedCaseInSwitchRector ([#&#8203;5258](https://github.com/rectorphp/rector-src/pull/5258)) - \[Performance]\[Renaming] Remove unnecessary array\_reverse() on RenameClassRector ([#&#8203;5266](https://github.com/rectorphp/rector-src/pull/5266)) - \[TypeDeclaration] Skip default not array type on StrictArrayParamDimFetchRector ([#&#8203;5259](https://github.com/rectorphp/rector-src/pull/5259)) - \[TypeDeclaration] Skip echo-ed on StrictArrayParamDimFetchRector ([#&#8203;5260](https://github.com/rectorphp/rector-src/pull/5260)) - \[Php71] Skip re-assigned as array on AssignArrayToStringRector ([#&#8203;5261](https://github.com/rectorphp/rector-src/pull/5261)) - \[Php71] Ensure re-assign after definition on AssignArrayToStringRector ([#&#8203;5262](https://github.com/rectorphp/rector-src/pull/5262)) - \[Renaming] Handle Rename no namespace to namespaced class with existing use statements ([#&#8203;5264](https://github.com/rectorphp/rector-src/pull/5264)) - \[Renaming]\[Performance] Re-structure check namespace only on renamed node got Namespace\_ ([#&#8203;5265](https://github.com/rectorphp/rector-src/pull/5265)) - \[Php81] Skip increment/decrement on ReadOnlyPropertyRector ([#&#8203;5267](https://github.com/rectorphp/rector-src/pull/5267)) - \[TypeDeclaration] Deprecate TypedPropertyFromStrictGetterMethodReturnTypeRector as depends on missing context and creates invalid code ([#&#8203;5269](https://github.com/rectorphp/rector-src/pull/5269)) - \[AutoImport] Fixing auto import on multiple @&#8203;\ usage ([#&#8203;5271](https://github.com/rectorphp/rector-src/pull/5271)) - \[Performance]\[Renaming] Use FullyQualified on RenameClassRector ([#&#8203;5272](https://github.com/rectorphp/rector-src/pull/5272)) - \[AutoImport] Handle complex usage of multiple @&#8203;\ combined with other doc ([#&#8203;5273](https://github.com/rectorphp/rector-src/pull/5273)) - \[AutoImport] Handle multi @&#8203;\ usage on multiline description ([#&#8203;5274](https://github.com/rectorphp/rector-src/pull/5274)) - \[Php80] Handle FQCN @&#8203;\ usage on AnnotationToAttributeRector ([#&#8203;5240](https://github.com/rectorphp/rector-src/pull/5240)) - \[BetterPhpDocParser] Handle nested doctrine annotation with single quote content ([#&#8203;5281](https://github.com/rectorphp/rector-src/pull/5281)) - \[Privatization] Skip method with parent call ([#&#8203;5283](https://github.com/rectorphp/rector-src/pull/5283)) - \[BetterPhpDocParser] Use ORIG\_NODE attribute on DoctrineAnnotationDecorator on handle @&#8203;\ after generic ([#&#8203;5285](https://github.com/rectorphp/rector-src/pull/5285)) - \[Php80] Allow subnamespace from use statements support on AnnotationToAttributeRector ([#&#8203;5287](https://github.com/rectorphp/rector-src/pull/5287)) <br> #### Removed :skull: - Remove deprecated Rector rules ([#&#8203;5270](https://github.com/rectorphp/rector-src/pull/5270)) ### [`v0.18.10`](https://github.com/rectorphp/rector/releases/tag/0.18.10): Released Rector 0.18.10 [Compare Source](https://github.com/rectorphp/rector/compare/0.18.9...0.18.10) #### Bugfixes :bug: - \[Renaming] FQN-ize namespaced import no namespace -> namespaced name on RenameClassRector ([#&#8203;5256](https://github.com/rectorphp/rector-src/pull/5256)) ### [`v0.18.9`](https://github.com/rectorphp/rector/releases/tag/0.18.9): Released Rector 0.18.9 [Compare Source](https://github.com/rectorphp/rector/compare/0.18.8...0.18.9) #### New Features 🥳 - \[DeadCode]: Support functions in RemoveUnusedVariableAssignRector ([#&#8203;5249](https://github.com/rectorphp/rector-src/pull/5249) - \[Performance]\[PostRector] Only process FullyQualified on import Node name on NameImportingPostRector ([#&#8203;5255](https://github.com/rectorphp/rector-src/pull/5255)) #### Bugfixes :bug: - \[AutoImport]\[Php70] Keep FQCN on conflict last name on TernaryToNullCoalescingRector ([#&#8203;5251](https://github.com/rectorphp/rector-src/pull/5251)) - \[Naming] Fix dotted name on generics bug in RenameVariableToMatchMethodCallReturnTypeRector ([#&#8203;5250](https://github.com/rectorphp/rector-src/pull/5250)) - \[Php73] Handle crash on JsonThrowOnErrorRector + SensitiveConstantNameRector ([#&#8203;5253](https://github.com/rectorphp/rector-src/pull/5253)) - \[CodingStyle] Refactor UseImportsAdder to return \[FileWithoutNamespace] code on no namespaced code ([#&#8203;5254](https://github.com/rectorphp/rector-src/pull/5254)) ### [`v0.18.8`](https://github.com/rectorphp/rector/releases/tag/0.18.8): Released Rector 0.18.8 [Compare Source](https://github.com/rectorphp/rector/compare/0.18.7...0.18.8) #### Bugfixes :bug: - Bump to reactphp/event-loop ^1.5 ([#&#8203;5246](https://github.com/rectorphp/rector-src/pull/5246)) - \[AutoImport] Skip auto import on no namespace used class on auto import enabled ([#&#8203;5247](https://github.com/rectorphp/rector-src/pull/5247)) - \[AutoImport]\[Renaming] Handle same last name no namespace just renamed auto import ([#&#8203;5248](https://github.com/rectorphp/rector-src/pull/5248)) ### [`v0.18.7`](https://github.com/rectorphp/rector/releases/tag/0.18.7): Released Rector 0.18.7 [Compare Source](https://github.com/rectorphp/rector/compare/0.18.6...0.18.7) #### New Features :partying\_face: - \[CodeQuality] Add negated support on SingleInArrayToCompareRector ([#&#8203;5205](https://github.com/rectorphp/rector-src/pull/5205)) - \[Php83] Adds rule for adding Override attribute ([#&#8203;5170](https://github.com/rectorphp/rector-src/pull/5170)), Thanks [@&#8203;peterfox](https://github.com/peterfox)! <br> #### Bugfixes :bug: - BinaryOpBetweenNumberAndStringRector don't trust phpdoc ([#&#8203;5199](https://github.com/rectorphp/rector-src/pull/5199)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[CodeQuality]\[Php70] Handle LocallyCalledStaticMethodToNonStaticRector + ThisCallOnStaticMethodToStaticCallRector must change both method and caller ([#&#8203;5196](https://github.com/rectorphp/rector-src/pull/5196)) - CountArrayToEmptyArrayComparisonRector: don't trust phpdoc ([#&#8203;5203](https://github.com/rectorphp/rector-src/pull/5203)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[TypeDeclaration] Skip union false on NumericReturnTypeFromStrictScalarReturnsRector ([#&#8203;5204](https://github.com/rectorphp/rector-src/pull/5204)) - \[CodeQuality] Handle negated isset on IssetOnPropertyObjectToPropertyExistsRector on property not exists ([#&#8203;5206](https://github.com/rectorphp/rector-src/pull/5206)) - \[CodeQuality] Handle crash no scope on ThrowWithPreviousExceptionRector+OptionalParametersAfterRequiredRector ([#&#8203;5207](https://github.com/rectorphp/rector-src/pull/5207)) - \[NodeTypeResolver] Clean up TryCatch\_ Scope filling ([#&#8203;5208](https://github.com/rectorphp/rector-src/pull/5208)) - \[PHPStanStaticTypeMapper] Clean up tweak false and bool check on UnionTypeMapper ([#&#8203;5209](https://github.com/rectorphp/rector-src/pull/5209)) - \[TypeDeclaration] Skip default numeric string on param int on ParamTypeByMethodCallTypeRector ([#&#8203;5210](https://github.com/rectorphp/rector-src/pull/5210)) - \[AutoImport] Handle AnnotationToAttributeRector + RenameClassRector then enable auto import ([#&#8203;5213](https://github.com/rectorphp/rector-src/pull/5213)) - \[Php80] Keep single quoted Argument Attribute on AnnotationToAttributeRector ([#&#8203;5214](https://github.com/rectorphp/rector-src/pull/5214)) - \[Php80] Keep single quoted key: 'value' on AnnotationToAttributeRector ([#&#8203;5215](https://github.com/rectorphp/rector-src/pull/5215)) - \[AutoImport] Ensure change to FullyQualified for Attribute on just changed from annotation ([#&#8203;5216](https://github.com/rectorphp/rector-src/pull/5216)) - \[Php52]\[Php70] Handle ContinueToBreakInSwitchRector + BreakNotInLoopOrSwitchToReturnRector ([#&#8203;5217](https://github.com/rectorphp/rector-src/pull/5217)) - \[Php80] Handle RenameClassRector+AnnotationToAttributeRector with auto import and existing attribute defined ([#&#8203;5219](https://github.com/rectorphp/rector-src/pull/5219)) - \[Testing] In case of failed test using multiple rules, show applied Rector rules to make easy to find them ([#&#8203;5222](https://github.com/rectorphp/rector-src/pull/5222)) - \[NodeTypeResolver] Handle nullable extended class on ->isObjectType() on DowngradeReflectionGetAttributesRector ([#&#8203;5224](https://github.com/rectorphp/rector-src/pull/5224)) - NullableCompareToNullRector: Don't trust phpdocs ([#&#8203;5225](https://github.com/rectorphp/rector-src/pull/5225)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[CodingStyle] Move ArraySpreadInsteadOfArrayMergeRector from php74 to codingstyle sets list ([#&#8203;5230](https://github.com/rectorphp/rector-src/pull/5230)) - \[PostRector] Ensure old classes in use statements cleaned up after rename attribuet on ClassRenamingPostRector ([#&#8203;5231](https://github.com/rectorphp/rector-src/pull/5231)) - RestoreDefaultNullToNullableTypePropertyRector: skip `@readonly` phpdoc ([#&#8203;5233](https://github.com/rectorphp/rector-src/pull/5233)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[AutoImport] Handle DeclareStrictTypesRector on importNames() enabled on no namespace ([#&#8203;5241](https://github.com/rectorphp/rector-src/pull/5241)) - \[AutoImport] Allow auto import just renamed [@&#8203;var](https://github.com/var) only docblock on RenameClassRector without removeUnusedImports() enabled ([#&#8203;5220](https://github.com/rectorphp/rector-src/pull/5220)) - Remove rule DataProviderArrayItemsNewlinedRector.php ([#&#8203;5227](https://github.com/rectorphp/rector-src/pull/5227)), Thanks [@&#8203;eerison](https://github.com/eerison)! - Remove `ArraySpreadInsteadOfArrayMergeRector` from `LevelSetList::UP_TO_PHP_74` ([#&#8203;5228](https://github.com/rectorphp/rector-src/pull/5228)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[DeadCode] Allow indirect duplicated grouping on RemoveDuplicatedCaseInSwitchRector ([#&#8203;5234](https://github.com/rectorphp/rector-src/pull/5234)) - \[DeadCode] Reduce double loop on RemoveDuplicatedCaseInSwitchRector ([#&#8203;5235](https://github.com/rectorphp/rector-src/pull/5235)) - \[DeadCode] Handle different indirect duplicated on RemoveDuplicatedCaseInSwitchRector ([#&#8203;5236](https://github.com/rectorphp/rector-src/pull/5236)) - \[DeadCode] Ensure change hasChanged flag on RemoveDuplicatedCaseInSwitchRector ([#&#8203;5237](https://github.com/rectorphp/rector-src/pull/5237)) - \[DeadCode] Handle repetitive jump equal case stmts on RemoveDuplicatedCaseInSwitchRector ([#&#8203;5239](https://github.com/rectorphp/rector-src/pull/5239)) - Rename parameter variable to nextCase on RemoveDuplicatedCaseInSwitchRector ([#&#8203;5244](https://github.com/rectorphp/rector-src/pull/5244)) ### [`v0.18.6`](https://github.com/rectorphp/rector/releases/tag/0.18.6): Released Rector 0.18.6 [Compare Source](https://github.com/rectorphp/rector/compare/0.18.5...0.18.6) #### New Features and Changes :partying\_face: - \[CodeQuality] Add CompleteMissingIfElseBracketRector ([#&#8203;5121](https://github.com/rectorphp/rector-src/pull/5121)) - \[CodeQuality] Add Else and ElseIf on CompleteMissingIfElseBracketRector ([#&#8203;5124](https://github.com/rectorphp/rector-src/pull/5124)) - \[TypeDeclaration] Utilize ClassMethodReturnTypeOverrideGuard on AddReturnTypeDeclarationFromYieldsRector ([#&#8203;5156](https://github.com/rectorphp/rector-src/pull/5156)) - \[DeadCode] Add RemoveUselessReturnExprInConstructRector ([#&#8203;5158](https://github.com/rectorphp/rector-src/pull/5158)) - Improve UnaryPlus and UnaryMinus support in isDynamicExpr ([#&#8203;5177](https://github.com/rectorphp/rector-src/pull/5177)), Thanks [@&#8203;JulianCBC](https://github.com/JulianCBC)! <br> #### Bugfixes :bug: - \[CodeQuality] Skip VB style if endif on CompleteMissingIfElseBracketRector ([#&#8203;5122](https://github.com/rectorphp/rector-src/pull/5122)) - \[CodeQuality] Skip direct InlineHTML on CompleteMissingIfElseBracketRector ([#&#8203;5125](https://github.com/rectorphp/rector-src/pull/5125)) - \[CodeQuality] Skip spaced elseif cond on CompleteMissingIfElseBracketRector ([#&#8203;5126](https://github.com/rectorphp/rector-src/pull/5126)) - \[CodeQuality] Only check start from current Stmt token pos up until open parentheses on CompleteMissingIfElseBracketRector ([#&#8203;5127](https://github.com/rectorphp/rector-src/pull/5127)) - \[CodeQuality] Handle all if,elseif,else no bracket on CompleteMissingIfElseBracketRector ([#&#8203;5129](https://github.com/rectorphp/rector-src/pull/5129)) - \[CodeQuality] Skip VB style in complex HTML on CompleteMissingIfElseBracketRector ([#&#8203;5132](https://github.com/rectorphp/rector-src/pull/5132)) - Skip `__construct()` in BoolReturnTypeFromStrictScalarReturnsRector ([#&#8203;5133](https://github.com/rectorphp/rector-src/pull/5133)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[CodeQuality] Handle missing bracket on If only on CompleteMissingIfElseBracketRector ([#&#8203;5134](https://github.com/rectorphp/rector-src/pull/5134)) - \[CodeQuality] Handle on closure, anonymous function, method call on CompleteMissingIfElseBracketRector ([#&#8203;5135](https://github.com/rectorphp/rector-src/pull/5135)) - \[CodeQuality] Use its start token pos on Else\_ on CompleteMissingIfElseBracketRector as no cond ([#&#8203;5136](https://github.com/rectorphp/rector-src/pull/5136)) - \[PhpParser] Reduce AstResolver complexity by move check fileName is null to parseFileNameToDecoratedNodes() ([#&#8203;5138](https://github.com/rectorphp/rector-src/pull/5138)) - \[TypeDeclaration] Handle Union with array type on ReturnUnionTypeRector ([#&#8203;5144](https://github.com/rectorphp/rector-src/pull/5144)) - \[TypeDeclaration] Handle union A extends B on ReturnUnionTypeRector ([#&#8203;5149](https://github.com/rectorphp/rector-src/pull/5149)) - \[CodeQuality] Fix missing parentheses on CombineIfRector ([#&#8203;5151](https://github.com/rectorphp/rector-src/pull/5151)) - \[TypeDeclaration] Utilize ClassMethodReturnTypeOverrideGuard on NumericReturnTypeFromStrictScalarReturnsRector ([#&#8203;5155](https://github.com/rectorphp/rector-src/pull/5155)) - \[CodeQuality] Handle negative and positive int/float on InlineConstructorDefaultToPropertyRector ([#&#8203;5159](https://github.com/rectorphp/rector-src/pull/5159)) - \[CodeQuality] Skip docblock usage on SimplifyBoolIdenticalTrueRector ([#&#8203;5161](https://github.com/rectorphp/rector-src/pull/5161)) - \[CodeQuality] Skip magic property fetch on IssetOnPropertyObjectToPropertyExistsRector ([#&#8203;5163](https://github.com/rectorphp/rector-src/pull/5163)) - \[PostRector] Reduce loop on ClassRenamingPostRector ([#&#8203;5174](https://github.com/rectorphp/rector-src/pull/5174)) - \[PostRector] Fix ClassRenamingPostRector return when no auto import replacement ([#&#8203;5175](https://github.com/rectorphp/rector-src/pull/5175)) - \[Renaming] Skip nullable object object|null on RenameMethodRector ([#&#8203;5181](https://github.com/rectorphp/rector-src/pull/5181)) - \[Downgradephp81]\[DowngradePhp80] Handle No scope crash on DowngradeSetAccessibleReflectionPropertyRector + DowngradeMatchToSwitchRector ([#&#8203;5183](https://github.com/rectorphp/rector-src/pull/5183)) - \[Naming] Skip DateTime from renaming, to keep convention of named dates ([#&#8203;5184](https://github.com/rectorphp/rector-src/pull/5184)) - Skip new self in RenameVariableToMatchNewTypeRector ([#&#8203;5185](https://github.com/rectorphp/rector-src/pull/5185)) - Skip DateTime in ExpectedNameResolver ([#&#8203;5186](https://github.com/rectorphp/rector-src/pull/5186)) - \[Naming] Skip all kinds of generators ([#&#8203;5187](https://github.com/rectorphp/rector-src/pull/5187)) - \[Renaming] Skip pointless names in RenameForeachValueVariableToMatchMethodCallReturnTypeRector ([#&#8203;5188](https://github.com/rectorphp/rector-src/pull/5188)) - \[Php70] Fix Php4 contructor not replaced with \_\_construct() on php 7.4 environment ([#&#8203;5189](https://github.com/rectorphp/rector-src/pull/5189)) - \[Php74]\[Php81] Allow mixed key on ArraySpreadInsteadOfArrayMergeRector on php 8.1 version feature enabled ([#&#8203;5190](https://github.com/rectorphp/rector-src/pull/5190)) - \[TypeDeclaration] Handle skipped by file path on DeclareStrictTypesRector due to use beforeTraverse() ([#&#8203;5191](https://github.com/rectorphp/rector-src/pull/5191)) - Fix phpstan notice $phpVersion on Rector\Config\RectorConfig::phpVersion() ([#&#8203;5193](https://github.com/rectorphp/rector-src/pull/5193)) - \[PHPStanStaticTypeMapper] Remove BoolUnionTypeAnalyzer on UnionTypeMapper ([#&#8203;5141](https://github.com/rectorphp/rector-src/pull/5141)) - \[DeadCode] Remove UnionType check on RecastingRemovalRector ([#&#8203;5142](https://github.com/rectorphp/rector-src/pull/5142)) - Remove src/constants.php for T\_ENUM and T\_NAME\_RELATIVE ([#&#8203;5143](https://github.com/rectorphp/rector-src/pull/5143)) - \[PHPStanStaticTypeMapper] Remove narrow string and int on UnionTypeMapper ([#&#8203;5145](https://github.com/rectorphp/rector-src/pull/5145)) - \[PHPStanStaticTypeMapper] Remove matchArrayTypes() on UnionTypeMapper ([#&#8203;5146](https://github.com/rectorphp/rector-src/pull/5146)) - \[DeadCode] Skip indirect variable definition on RemoveNonExistingVarAnnotationRector ([#&#8203;5152](https://github.com/rectorphp/rector-src/pull/5152)) - \[DeadCode] Skip key used in next stmt on RemoveUnusedForeachKeyRector ([#&#8203;5153](https://github.com/rectorphp/rector-src/pull/5153)) - \[DeadCode] Skip used in next For\_/Foreach\_ on RemoveDeadIfForeachForRector ([#&#8203;5154](https://github.com/rectorphp/rector-src/pull/5154)) - \[DeadCode] Handle file\_get\_contents() only remove variable on RemoveUnusedVariableAssignRector ([#&#8203;5162](https://github.com/rectorphp/rector-src/pull/5162)) - \[DeadCode] Skip count() on mixed on RemoveUnusedNonEmptyArrayBeforeForeachRector ([#&#8203;5160](https://github.com/rectorphp/rector-src/pull/5160)) - RemoveUnusedNonEmptyArrayBeforeForeachRector: ignore phpdoc types ([#&#8203;5169](https://github.com/rectorphp/rector-src/pull/5169)), Thanks [@&#8203;staabm](https://github.com/staabm)! - RemoveUnusedNonEmptyArrayBeforeForeachRector: skip array dim fetch ([#&#8203;5166](https://github.com/rectorphp/rector-src/pull/5166)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[DeadCode] Skip return false pseudo type in union on RemoveUselessReturnTagRector ([#&#8203;5172](https://github.com/rectorphp/rector-src/pull/5172)) - \[AutoImport] \[Renaming] Skip remove used use statement on annotation during rename + auto import when no replacement on auto import ([#&#8203;5168](https://github.com/rectorphp/rector-src/pull/5168)) - \[DeadCode] Mirror comment on assign method call on RemoveUnusedVariableAssignRector ([#&#8203;5195](https://github.com/rectorphp/rector-src/pull/5195)) ### [`v0.18.5`](https://github.com/rectorphp/rector/releases/tag/0.18.5): Released Rector 0.18.5 [Compare Source](https://github.com/rectorphp/rector/compare/0.18.4...0.18.5) #### New Features and Improvements :partying\_face: - \[build] Remove duplicated phpstan/phpstan from the build, as require by build package in composer.json already ([rectorphp/rector-src@`51ed7b6`](https://github.com/rectorphp/rector-src/commit/51ed7b693fbfab70cf6a246bec4cc35f0ceacf7a)) - AddParamTypeBasedOnPHPUnitDataProviderRector: Check all data providers ([#&#8203;5068](https://github.com/rectorphp/rector-src/pull/5068)), Thanks [@&#8203;jlherren](https://github.com/jlherren)! - AddParamTypeBasedOnPHPUnitDataProviderRector: Enhance existing rule to handle PHPUnit 10+ DataProvider Attribute ([#&#8203;4925](https://github.com/rectorphp/rector-src/pull/4925)), Thanks [@&#8203;mcampbell508](https://github.com/mcampbell508)! - make PhpDocInfo::findByAnnotationClass() public to use in Symfony rules ([#&#8203;5103](https://github.com/rectorphp/rector-src/pull/5103)) <br> #### Bugfixes :bug: - Feature/fix class annotation bad print ([#&#8203;5081](https://github.com/rectorphp/rector-src/pull/5081)), Thanks [@&#8203;etshy](https://github.com/etshy)! - \[Performance] Avoid ReflectionProvider check function exists on NameImportingPostRector ([#&#8203;5083](https://github.com/rectorphp/rector-src/pull/5083)) - InlineConstructorDefaultToPropertyRector Readonly Class ([#&#8203;5085](https://github.com/rectorphp/rector-src/pull/5085)), Thanks [@&#8203;beschoenen](https://github.com/beschoenen)! - \[CodeQuality] Handle crash on variable variable on assign closure on OptionalParametersAfterRequiredRector ([#&#8203;5089](https://github.com/rectorphp/rector-src/pull/5089)) - \[NodeTypeResolver] Use isScalar()->yes() usage on StaticTypeAnalyzer and ScalarTypeComparator services ([#&#8203;5099](https://github.com/rectorphp/rector-src/pull/5099)) - \[ProcessAnalyzer] Ensure instanceof Stmt on check infinite loop on not yet has "created\_by\_rule" attribute ([#&#8203;5100](https://github.com/rectorphp/rector-src/pull/5100)) - \[DX] Rename shouldImportName() to shouldSkipName() on ClassNameImportSkipper ([#&#8203;5107](https://github.com/rectorphp/rector-src/pull/5107)) - The ReturnTypeFromReturnNewRector must only handle new instances, to avoid leaking to everything ([#&#8203;5115](https://github.com/rectorphp/rector-src/pull/5115)) - \[Php80] Skip when already implements Stringable and has string return type on StringableForToStringRector ([#&#8203;5120](https://github.com/rectorphp/rector-src/pull/5120)) <br> #### Removed and Deprecated :skull: - \[DX] Remove CurrentFileProvider dependency on ChangedNodeScopeRefresher ([#&#8203;5087](https://github.com/rectorphp/rector-src/pull/5087)) - \[DX] Remove DependencyClassMethodDecorator as not used anymore due to paralel nature ([#&#8203;5094](https://github.com/rectorphp/rector-src/pull/5094)) - \[PostRector] Remove CurrentFileProvider on PostFileProcessor ([#&#8203;5097](https://github.com/rectorphp/rector-src/pull/5097)) - \[Comments] Remove unused copy Node object on CommentRemover ([#&#8203;5103](https://github.com/rectorphp/rector-src/pull/5103)) - \[Performance]\[AutoImport] Remove just renamed check on ClassNameImportSkipper ([#&#8203;5106](https://github.com/rectorphp/rector-src/pull/5106)) - Deprecate CountOnNullRector as depends on previous context and require manual adjustment of previous result ([#&#8203;5101](https://github.com/rectorphp/rector-src/pull/5101)) ### [`v0.18.4`](https://github.com/rectorphp/rector/releases/tag/0.18.4): Released Rector 0.18.4 [Compare Source](https://github.com/rectorphp/rector/compare/0.18.3...0.18.4) #### New Features and Improvements :partying\_face: - **Introducing Collectors** :partying\_face: - processing collected data + test case ([#&#8203;4970](https://github.com/rectorphp/rector-src/pull/4970)) - Run tests on macos ([#&#8203;5019](https://github.com/rectorphp/rector-src/pull/5019)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Move betterNodeFinder, valueResolver, phpDocInfoFactory dependencies from AbstractRector into rules ([#&#8203;5071](https://github.com/rectorphp/rector-src/pull/5071)) - DX: Validate paths in RectorConfig->paths() ([#&#8203;5065](https://github.com/rectorphp/rector-src/pull/5065)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[DX] Make PhpDocInfoFactory explicitly required in Rector rule constructor, if needed ([#&#8203;5051](https://github.com/rectorphp/rector-src/pull/5051)) - \[DX] Make ValueResolver explicitly required in Rector rules constructor if needed ([#&#8203;5052](https://github.com/rectorphp/rector-src/pull/5052)) <br> #### Bugfixes :bug: - \[DeadCode] RemoveDeadZeroAndOneOperationRector should not remove Constants ([#&#8203;4910](https://github.com/rectorphp/rector-src/pull/4910)), Thanks [@&#8203;TwanVermeulen](https://github.com/TwanVermeulen)! - \[PostRector] Fix unused import not removed on empty generic class name exists ([#&#8203;5012](https://github.com/rectorphp/rector-src/pull/5012)) - \[Parallel] Handle Spaced root project main script on parallel process ([#&#8203;4813](https://github.com/rectorphp/rector-src/pull/4813)) - Fix TypedPropertyFromStrictConstructor\* order ([#&#8203;5021](https://github.com/rectorphp/rector-src/pull/5021)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[DX] Lower current node dependency - pass it directly to doc node parsing ([#&#8203;5023](https://github.com/rectorphp/rector-src/pull/5023)) - \[AutoImport] Fix conflict current namespace auto import ([#&#8203;5024](https://github.com/rectorphp/rector-src/pull/5024)) - Simplify UseIdenticalOverEqualWithSameTypeRector ([#&#8203;5029](https://github.com/rectorphp/rector-src/pull/5029)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[Performance]\[Testing] Use str\_contains instead of regex in FixtureSplitter ([#&#8203;5030](https://github.com/rectorphp/rector-src/pull/5030)) - Fix ArrayKeyFirstLastRector: Skip exection when pointer is changed ([#&#8203;5038](https://github.com/rectorphp/rector-src/pull/5038)), Thanks [@&#8203;scyzoryck](https://github.com/scyzoryck)! - \[TypeDeclaration] Handle fallback from param same type object on ReturnTypeFromReturnNewRector ([#&#8203;5039](https://github.com/rectorphp/rector-src/pull/5039)) - \[NodeTypeResolver] Use Scope->getType() on ArrayDimFetch on NodeTypeResolver::getNativeType() ([#&#8203;5037](https://github.com/rectorphp/rector-src/pull/5037)) - \[NodeTypeResolver] pull getType() on ArrayDimFetch when not mixed type from its variable native definition ([#&#8203;5056](https://github.com/rectorphp/rector-src/pull/5056)) - \[CodingStyle]\[EarlyReturn] Fix infinite if else on BinarySwitchToIfElseRector+RemoveAlwaysElseRector ([#&#8203;5057](https://github.com/rectorphp/rector-src/pull/5057)) - \[TypeDeclaration] Skip ArrayDimFetch for return and param types ([#&#8203;5059](https://github.com/rectorphp/rector-src/pull/5059)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[NodeTypeResolver] Handle optional array shape on native function like with ArrayDimFetch ([#&#8203;5062](https://github.com/rectorphp/rector-src/pull/5062)) - \[Php80] Mirror switch comment to match to ChangeSwitchToMatchRector ([#&#8203;5072](https://github.com/rectorphp/rector-src/pull/5072)) - \[AutoImport] Skip case insensitive conflict defined class name on $rectorConfig->importNames() ([#&#8203;5076](https://github.com/rectorphp/rector-src/pull/5076)) - Docblock fix on ShortNameResolver ([#&#8203;5077](https://github.com/rectorphp/rector-src/pull/5077)) - \[TypeDeclaration] Add return static property support on ReturnTypeFromStrictTypedPropertyRector ([#&#8203;5050](https://github.com/rectorphp/rector-src/pull/5050)) <br> #### Removed and Deprecated :skull: - \[Config] Remove asterisk support in import() for file, use explicit paths instead ([#&#8203;5010](https://github.com/rectorphp/rector-src/pull/5010)) - \[Performance] Remove regex check on open tag spaced check on FileProcessor ([#&#8203;5073](https://github.com/rectorphp/rector-src/pull/5073)) - Deprecate TypedPropertyFromStrictConstructorReadonlyClassRector as based on docblock and public elements; use private elements and property promotion instead ([#&#8203;5049](https://github.com/rectorphp/rector-src/pull/5049)) - Deprecate BinarySwitchToIfElseRector as opinionated to allow more suitable match() refactoring ([#&#8203;5064](https://github.com/rectorphp/rector-src/pull/5064)) ### [`v0.18.3`](https://github.com/rectorphp/rector/releases/tag/0.18.3): Released Rector 0.18.3 [Compare Source](https://github.com/rectorphp/rector/compare/0.18.2...0.18.3) #### New Features and Changes :partying\_face: - **\[BC] docblock changes in custom Rector rules now have to be reprinted directly in the rule - [#&#8203;8201 (comment)](https://github.com/rectorphp/rector/issues/8201#issue-1894148095)** - \[TypeDeclaration] Add return empty string defined support on ReturnTypeFromStrictScalarReturnExprRector ([#&#8203;4919](https://github.com/rectorphp/rector-src/pull/4919)) - \[TypeDeclaration] Add fallback return direct array support on ReturnTypeFromStrictNewArrayRector ([#&#8203;4928](https://github.com/rectorphp/rector-src/pull/4928)) - \[TypeDeclaration] Add init assign method call support on ReturnTypeFromStrictNewArrayRector ([#&#8203;4929](https://github.com/rectorphp/rector-src/pull/4929)) - \[TypeDeclaration] Ensure ArrayType on ReturnTypeFromStrictNewArrayRector::shouldAddReturnArrayDocType() ([#&#8203;4932](https://github.com/rectorphp/rector-src/pull/4932)) - \[TypeDeclaration] Add test fixture return docblock on init method call assign as skipped on ReturnTypeFromStrictNewArrayRector ([#&#8203;4933](https://github.com/rectorphp/rector-src/pull/4933)) - \[TypeDeclaration] Add non native function return support on ReturnTypeFromStrictScalarReturnExprRector ([#&#8203;4934](https://github.com/rectorphp/rector-src/pull/4934)) - **BC: Separated regex matching in NodeNameResolver->isName() ([#&#8203;4951](https://github.com/rectorphp/rector-src/pull/4951)), Thanks [@&#8203;staabm](https://github.com/staabm)!** - Add support for Custom Skip Voters ([#&#8203;5002](https://github.com/rectorphp/rector-src/pull/5002)), Thanks [@&#8203;kaczenski](https://github.com/kaczenski)! - Implement a max jobs per worker budget ([#&#8203;4965](https://github.com/rectorphp/rector-src/pull/4965)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Prevent unnecessary calls to spl\_object\_id() ([#&#8203;4992](https://github.com/rectorphp/rector-src/pull/4992)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Refactor use import resolving ([#&#8203;4998](https://github.com/rectorphp/rector-src/pull/4998)), Thanks [@&#8203;staabm](https://github.com/staabm)! - NodeNameResolver: Throw exception in BC breaking path ([#&#8203;4980](https://github.com/rectorphp/rector-src/pull/4980)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[Internals] Decouple output from AbstractRector, narrow debugging output to file path ([#&#8203;4976](https://github.com/rectorphp/rector-src/pull/4976)) - Update docblock only when changed, directly in rector rule ([#&#8203;4986](https://github.com/rectorphp/rector-src/pull/4986)) <br> #### Bugfixes :bug: - AddVoidReturnTypeWhereNoReturnRector: fix never type handling ([#&#8203;4918](https://github.com/rectorphp/rector-src/pull/4918)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[TypeDeclaration] Skip return after return closure on AddVoidReturnTypeWhereNoReturnRector ([#&#8203;4930](https://github.com/rectorphp/rector-src/pull/4930)) - \[TypeDeclaration] Use $type->isScalar()->yes() on AlwaysStrictScalarExprAnalyzer ([#&#8203;4920](https://github.com/rectorphp/rector-src/pull/4920)) - Refactor BetterNodeFinder::findFirstInFunctionLikeScoped() to work with SilentVoidResolver ([#&#8203;4931](https://github.com/rectorphp/rector-src/pull/4931)) - \[NodeTypeResolver] Handle isObjectType() on new $class dynamic variable should return false compare to Object FQCN ([#&#8203;4936](https://github.com/rectorphp/rector-src/pull/4936)) - \[Testing] Fix running unit test on macOS ([#&#8203;4941](https://github.com/rectorphp/rector-src/pull/4941)) - Faster name resolving ([#&#8203;4955](https://github.com/rectorphp/rector-src/pull/4955)), Thanks [@&#8203;staabm](https://github.com/staabm)! - UseImportsTraverser: don't deep traverse ([#&#8203;4994](https://github.com/rectorphp/rector-src/pull/4994)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[tests] Replace wildcard e2e test with unit one ([#&#8203;5000](https://github.com/rectorphp/rector-src/pull/5000)) - \[DocBlock] Update docblock contents right in the rule ([#&#8203;4999](https://github.com/rectorphp/rector-src/pull/4999)) - \[PhpParser] Fix crash read jetbrains/phpstorm-stubs included in phpstan.phar on PHP 8.0 and PHP 7.4 ([#&#8203;5001](https://github.com/rectorphp/rector-src/pull/5001)) - RenameFunctionRector: prevent repeated isName() calls ([#&#8203;5003](https://github.com/rectorphp/rector-src/pull/5003)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Make PhpDocINfo::removeByType() return bool to inform about changed node ([#&#8203;4979](https://github.com/rectorphp/rector-src/pull/4979)) <br> #### Removed :skull: - \[cleanup] Remove deprecated NonPhpRectorInterface, PseudoNamespaceToNamespaceRector and mysql to mysqli sets ([#&#8203;4927](https://github.com/rectorphp/rector-src/pull/4927)) - Remove UnSpreadOperatorRector as not clear value and spread used on purpose ([#&#8203;4949](https://github.com/rectorphp/rector-src/pull/4949)) - \[Naming] Remove matchesStringName() check completely from NodeNameResolver, including endsWith() method - use getName() and compare directly instead ([#&#8203;4954](https://github.com/rectorphp/rector-src/pull/4954)) - \[Performance]\[Php55] Remove regex replace e on RegexMatcher ([#&#8203;4974](https://github.com/rectorphp/rector-src/pull/4974)) - Remove CurrentRectorProvider and used for docblock changes report, return bool value and node directly in the rector rule instead ([#&#8203;4982](https://github.com/rectorphp/rector-src/pull/4982)) - Deprecated PhpDocInfo::markAsChanged() to ensure doc block is changed directly in the Rector rule ([#&#8203;4987](https://github.com/rectorphp/rector-src/pull/4987)) ### [`v0.18.2`](https://github.com/rectorphp/rector/releases/tag/0.18.2): Released Rector 0.18.2 [Compare Source](https://github.com/rectorphp/rector/compare/0.18.1...0.18.2) #### New Features and Changes :partying\_face: - Add MyCLabs enum equals + keeping methods ([#&#8203;4645](https://github.com/rectorphp/rector-src/pull/4645)), Thanks [@&#8203;K0nias](https://github.com/K0nias)! - \[TypeDeclaration] skip variadic constructor param of mixed type on AddParamTypeFromPropertyTypeRector ([#&#8203;4887](https://github.com/rectorphp/rector-src/pull/4887)), Thanks [@&#8203;Celebrate-Reinhard](https://github.com/Celebrate-Reinhard)! - \[TypeDeclaration] Do not add default value when assigned in \_\_construct() on TypedPropertyFromStrictGetterMethodReturnTypeRector ([#&#8203;4886](https://github.com/rectorphp/rector-src/pull/4886)) - \[TypeDeclaration] Add ReturnTypeFromStrictFluentReturnRector ([#&#8203;4890](https://github.com/rectorphp/rector-src/pull/4890)) - Add single value concat support to EncapsedStringsToSprintfRector ([#&#8203;4897](https://github.com/rectorphp/rector-src/pull/4897)) - Add number support to concat EncapsedStringsToSprintfRector ([#&#8203;4898](https://github.com/rectorphp/rector-src/pull/4898)) - \[DeadCode] Remove [@&#8203;return](https://github.com/return) void on return self on RemoveUselessReturnTagRector ([#&#8203;4894](https://github.com/rectorphp/rector-src/pull/4894)) - Add test case for caching $rectorConfig->rules() changed ([#&#8203;4903](https://github.com/rectorphp/rector-src/pull/4903)) - \[CodeQuality] Add NumberCompareToMaxFuncCallRector ([#&#8203;4914](https://github.com/rectorphp/rector-src/pull/4914)) - \[TypeDeclaration] Add return self object support on ReturnTypeFromStrictFluentReturnRector ([#&#8203;4915](https://github.com/rectorphp/rector-src/pull/4915)) - \[TypeDeclaration] Add return static object support on ReturnTypeFromStrictFluentReturnRector ([#&#8203;4916](https://github.com/rectorphp/rector-src/pull/4916)) <br> #### Bugfixes :bug: - \[Caching] Add VersionResolver::PACKAGE\_VERSION to FileHashComputer::compute() so cache cleared on composer update got new version ([#&#8203;4904](https://github.com/rectorphp/rector-src/pull/4904)) - \[TypeDeclaration] Using ClassMethodReturnTypeOverrideGuard on ReturnTypeFromStrictParamRector ([#&#8203;4878](https://github.com/rectorphp/rector-src/pull/4878)) - \[e2e] $rectorConfig->skip() should not skip inside different path over config ([#&#8203;4882](https://github.com/rectorphp/rector-src/pull/4882)) - Fix missing default string in TypedPropertyFromStrictGetterMethodReturnTypeRector ([#&#8203;4885](https://github.com/rectorphp/rector-src/pull/4885)) - Fix tests fixture updater ([#&#8203;4892](https://github.com/rectorphp/rector-src/pull/4892)) - Fix union type check of object ([#&#8203;4893](https://github.com/rectorphp/rector-src/pull/4893)) - Simplify isMatchingUnionType() ([#&#8203;4895](https://github.com/rectorphp/rector-src/pull/4895)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Skip identical to false in SimplifyBoolIdenticalTrueRector, as exact comparison is stronger than negated expression ([#&#8203;4901](https://github.com/rectorphp/rector-src/pull/4901)) - Fix Rector invalidation in case of changes sets or rules ([#&#8203;4902](https://github.com/rectorphp/rector-src/pull/4902)) - \[TypeDeclaration] Skip mixing native + docblock union assign on TypedPropertyFromAssignsRector ([#&#8203;4905](https://github.com/rectorphp/rector-src/pull/4905)) - StrictArrayParamDimFetchRector: Skip objects ([#&#8203;4907](https://github.com/rectorphp/rector-src/pull/4907)), Thanks [@&#8203;staabm](https://github.com/staabm)! - FamilyRelationsAnalyzer: final classes can't have children ([#&#8203;4913](https://github.com/rectorphp/rector-src/pull/4913)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[Config] Remove $isBound usage as cause empty configuration on RectorConfig ([#&#8203;4880](https://github.com/rectorphp/rector-src/pull/4880)) ### [`v0.18.1`](https://github.com/rectorphp/rector/releases/tag/0.18.1): Released Rector 0.18.1 [Compare Source](https://github.com/rectorphp/rector/compare/0.18.0...0.18.1) This release is accompanied by 2 posts that explains behind the scenes context: - [Rector 0.18 - From Symfony Container to Laravel and How to Upgrade your Extensions](https://getrector.com/blog/rector-018-from-symfony-container-to-laravel-and-how-to-upgrade-your-extensions) - [Rector 0.18 - How we made tests Seven Times Faster](https://getrector.com/blog/rector-018-how-we-made-tests-seven-times-faster) <br> #### New Features and Changes :partying_face: - **\[CI] Narrow tests to single job, as now takes 20 s :rocket:** ([#&#8203;4827](https://github.com/rectorphp/rector-src/pull/4827)) - \[Config] Handle $rectorConfig->import() with wildcards \* config ([#&#8203;4832](https://github.com/rectorphp/rector-src/pull/4832)) - \[DX] Display rule count in list-rules ([#&#8203;4848](https://github.com/rectorphp/rector-src/pull/4848)) - Skip PHPDoc return type in AddReturnTypeDeclarationBasedOnParentClassMethodRector ([#&#8203;4809](https://github.com/rectorphp/rector-src/pull/4809)), Thanks [@&#8203;staabm](https://github.com/staabm)! - AddReturnTypeDeclarationBasedOnParentClassMethodRector: don't trust phpdoc types ([#&#8203;4810](https://github.com/rectorphp/rector-src/pull/4810)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[DX] Add optional testdox/pest like output to get exact test metrics per unit test fixture ([#&#8203;4821](https://github.com/rectorphp/rector-src/pull/4821)) - \[TypeDeclaration] Add new array replaced with array on ReturnTypeFromStrictNewArrayRector ([#&#8203;4825](https://github.com/rectorphp/rector-src/pull/4825)) - \[DX] Merge PhpRectorInterface to RectorInterface as identical contract and separation no longer needed ([#&#8203;4812](https://github.com/rectorphp/rector-src/pull/4812)) - \[PHPStan] Avoid removing bleeding edge from phar include, let user handle own phpstan configuration ([#&#8203;4840](https://github.com/rectorphp/rector-src/pull/4840)) <br> #### Bugfixes :bug: - \[Php73]\[Php80] Handle empty long array syntax default value on SensitiveConstantNameRector+AddParamBasedOnParentClassMethodRector ([#&#8203;4837](https://github.com/rectorphp/rector-src/pull/4837)) - \[Config] Add merging of rules configuration, call configure() just once ([#&#8203;4838](https://github.com/rectorphp/rector-src/pull/4838)) - Fix RenamePropertyToMatchTypeRector to skip Laravel collections and avoid accident rename ([#&#8203;4811](https://github.com/rectorphp/rector-src/pull/4811)) - \[BetterPhpDocParser] Enable textBetweenTagsBelongsToDescription on BetterPhpDocParser extends PhpDocParser ([#&#8203;4817](https://github.com/rectorphp/rector-src/pull/4817)) - \[PHPUnit] Fix extreemely slow PHPUnit run on data providers with objects ([#&#8203;4823](https://github.com/rectorphp/rector-src/pull/4823)) - \[AutoImport] Handle case insensitive name collide on auto import ([#&#8203;4829](https://github.com/rectorphp/rector-src/pull/4829)) - \[Traverser] Set explicitely nodeConnectingVisitorCompatibility: false config in config/phpstan/static-reflection.neon ([#&#8203;4841](https://github.com/rectorphp/rector-src/pull/4841)) - replaces `get_headers` $associative with bool ([#&#8203;4850](https://github.com/rectorphp/rector-src/pull/4850)), Thanks [@&#8203;mvhirsch](https://github.com/mvhirsch)! - \[Php55]\[Renaming] Handle rename string on combination StringClassNameToClassConstantRector+RenameStringRector ([#&#8203;4869](https://github.com/rectorphp/rector-src/pull/4869)) - \[Php80] Handle crash parent default empty array/string param on AddParamBasedOnParentClassMethodRector ([#&#8203;4833](https://github.com/rectorphp/rector-src/pull/4833)) <br> #### Removed :skull: - Remove deprecated `FileProcessorInterface` ([#&#8203;4835](https://github.com/rectorphp/rector-src/pull/4835)) - Remove `SwapFuncCallArgumentsRector` as keeps swaping to infinity, use custom rule instead ([#&#8203;4874](https://github.com/rectorphp/rector-src/pull/4874)) ### [`v0.18.0`](https://github.com/rectorphp/rector/releases/tag/0.18.0): Released Rector 0.18.0 with Laravel container ⚡️ [Compare Source](https://github.com/rectorphp/rector/compare/0.17.13...0.18.0) #### New Features and Changes :partying\_face: - **\[DI] Switch container to Laravel - final step 🥳 ([#&#8203;4698](https://github.com/rectorphp/rector-src/pull/4698))** - do you use `$rectorConfig->import('src/*');` with mask? - this is removed now, use explicit real paths instead - \[DI] Remove symfony/dependency-injection dependency ([#&#8203;4796](https://github.com/rectorphp/rector-src/pull/4796)) - \[DI] Add symfony config BC warnings layer, to inform about an upgrade ([#&#8203;4800](https://github.com/rectorphp/rector-src/pull/4800)) - Add possibility to add multiple phpstan configs ([#&#8203;4798](https://github.com/rectorphp/rector-src/pull/4798)), Thanks [@&#8203;alexander-schranz](https://github.com/alexander-schranz)! - \[DX] Make use of `addParameter()` ([#&#8203;4801](https://github.com/rectorphp/rector-src/pull/4801)) - Add deprecation warning for `FileProcessorInterface` ([#&#8203;4808](https://github.com/rectorphp/rector-src/pull/4808)) <br> #### Bugfixes :bug: - \[DeadCode] Handle duplicated annotation on space before close parentheses on RemoveUselessParamTagRector ([#&#8203;4795](https://github.com/rectorphp/rector-src/pull/4795)) - Fix skip() Rector class, make container forget it comleteely ([#&#8203;4807](https://github.com/rectorphp/rector-src/pull/4807)) ### [`v0.17.13`](https://github.com/rectorphp/rector/releases/tag/0.17.13): Released Rector 0.17.13 [Compare Source](https://github.com/rectorphp/rector/compare/0.17.12...0.17.13) #### New Features and Changes :partying\_face: - \[TypeDeclaration] Skip in conditional on AddParamTypeFromPropertyTypeRector ([#&#8203;4779](https://github.com/rectorphp/rector-src/pull/4779)) - \[DX] Deprecate NonPhpRectorInterface, the only rule and its file processor, to make Rector handle exlusively PHP ([#&#8203;4761](https://github.com/rectorphp/rector-src/pull/4761)) - Bump nikic/php-parser to 4.17 ([#&#8203;4781](https://github.com/rectorphp/rector-src/pull/4781)) <br> #### Removed :skull: - Remove SwapMethodCallArgumentsRector as could lead to infinite swapping, use custom rule with type/value check instead ([#&#8203;4766](https://github.com/rectorphp/rector-src/pull/4766)) - \[Php81] Remove IntersectionTypesRector as rely on docblock ([#&#8203;4784](https://github.com/rectorphp/rector-src/pull/4784)) <br> #### Bugfixes :bug: - \[DeadCode] Skip used by trait on RemoveUnusedPrivateMethodRector ([#&#8203;4770](https://github.com/rectorphp/rector-src/pull/4770)) - \[DeadCode] Skip used by trait inside Closure on RemoveUnusedPrivateMethodRector ([#&#8203;4773](https://github.com/rectorphp/rector-src/pull/4773)) - \[e2e] Handle $rectorConfig->paths() with wilcards \* config ([#&#8203;4765](https://github.com/rectorphp/rector-src/pull/4765)) - \[Config] Move from magic loading of all PHPStan extensions, their bootstrap files etc. under control with explicit file listing ([#&#8203;4769](https://github.com/rectorphp/rector-src/pull/4769)) - \[TypeDeclaration] Handle crash on concat param append returned used on Arg on StrictStringParamConcatRector ([#&#8203;4774](https://github.com/rectorphp/rector-src/pull/4774)) - \[TypeDeclaration] Skip param re-assign on Strict Param rules ([#&#8203;4775](https://github.com/rectorphp/rector-src/pull/4775)) - \[TypeDeclaration] Skip param int on StrictStringParamConcatRector ([#&#8203;4780](https://github.com/rectorphp/rector-src/pull/4780)) - \[PHPStanStaticTypeMapper] Allow Closure type on ClosureTypeMapper based on PHP versions ([#&#8203;4785](https://github.com/rectorphp/rector-src/pull/4785)) - \[PHPStanStaticTypeMapper] Allow standalone null type on NullTypeMapper on php 8.2 ([#&#8203;4783](https://github.com/rectorphp/rector-src/pull/4783)) - Make SimplifyUselessVariableRector run without scope ([#&#8203;4791](https://github.com/rectorphp/rector-src/pull/4791)) - Make NullToStrictStringFuncCallArgRector run without scope ([#&#8203;4792](https://github.com/rectorphp/rector-src/pull/4792)) ### [`v0.17.12`](https://github.com/rectorphp/rector/compare/0.17.11...0.17.12) [Compare Source](https://github.com/rectorphp/rector/compare/0.17.11...0.17.12) ### [`v0.17.11`](https://github.com/rectorphp/rector/releases/tag/0.17.11): Released Rector 0.17.11 [Compare Source](https://github.com/rectorphp/rector/compare/0.17.10...0.17.11) #### New Features and Improvements :partying\_face: - \[TypeDeclaration] Add nullable param from null compare on StrictStringParamConcatRector ([#&#8203;4636](https://github.com/rectorphp/rector-src/pull/4636)) - \[TypeDeclaration] Add ReturnUnionTypeRector ([#&#8203;4655](https://github.com/rectorphp/rector-src/pull/4655)) - \[TypeDeclaration] Skip public method on AddMethodCallBasedStrictParamTypeRector ([#&#8203;4659](https://github.com/rectorphp/rector-src/pull/4659)) - \[CodeQuality]\[TypeDeclaration] Add string append support on ReturnTypeFromStrictScalarReturnExprRector ([#&#8203;4657](https://github.com/rectorphp/rector-src/pull/4657)) - \[TypeDeclaration] Handle anonymous class in union on AddArrowFunctionReturnTypeRector ([#&#8203;4676](https://github.com/rectorphp/rector-src/pull/4676)) - \[Types] Make AddVoidReturnTypeWhereNoReturnRector work only with type-declaration, as reliable ([#&#8203;4720](https://github.com/rectorphp/rector-src/pull/4720)) - \[TypeDeclaration] Allow change multiple methods on AddParamTypeDeclarationRector ([#&#8203;4727](https://github.com/rectorphp/rector-src/pull/4727)) - \[DX] Add ProcessConfigureDecorator to avoid superfluous composition ([#&#8203;4734](https://github.com/rectorphp/rector-src/pull/4734)) - \[Logging] Add RectorOutput logging service ([#&#8203;4736](https://github.com/rectorphp/rector-src/pull/4736)) - \[DX] Cache rector test config loading by file + class to avoid booting over and over per fixture ([#&#8203;4718](https://github.com/rectorphp/rector-src/pull/4718)) - \[DX] Validate rules no longer existing rules in $rectorConfig->skip() ([#&#8203;4728](https://github.com/rectorphp/rector-src/pull/4728)) - \[DX] Merge RectorOutputStyle, OutputStyleInterface to RectorStyle ([#&#8203;4711](https://github.com/rectorphp/rector-src/pull/4711)) <br> #### Bugfixes :bug: - \[TypeDeclaration] Do not change different type defualt value on StrictStringParamConcatRector ([#&#8203;4635](https://github.com/rectorphp/rector-src/pull/4635)) - \[Strict] Skip docblock on BooleanInTernaryOperatorRuleFixerRector ([#&#8203;4638](https://github.com/rectorphp/rector-src/pull/4638)) - \[Strict] Skip docblock on DisallowedShortTernaryRuleFixerRector ([#&#8203;4639](https://github.com/rectorphp/rector-src/pull/4639)) - \[Strict] Skip docblock on BooleanInBooleanNotRuleFixerRector ([#&#8203;4640](https://github.com/rectorphp/rector-src/pull/4640)) - \[TypeDeclaration] Using native type scope get on ReturnTypeInferer ([#&#8203;4648](https://github.com/rectorphp/rector-src/pull/4648)) - \[CodingStyle]\[Php80]\[Privatization] Handle SeparateMultiUseImportsRector+ClassPropertyAssignToConstructorPromotionRector+FinalizeClassesWithoutChildrenRector cause invalid removal ([#&#8203;4649](https://github.com/rectorphp/rector-src/pull/4649)) - \[DX] Cleanup ForRepeatedCountToOwnVariableRector counter ([#&#8203;4651](https://github.com/rectorphp/rector-src/pull/4651)) - \[DX] Make MoneyFormatToNumberFormatRector wrap func call directly to keep simple ([#&#8203;4653](https://github.com/rectorphp/rector-src/pull/4653)) - Move ArrayManipulator to rector-symfony, where only used ([#&#8203;4656](https://github.com/rectorphp/rector-src/pull/4656)) - \[DX] Move FlipNegatedTernaryInstanceofRector to instanceof rules category ([#&#8203;4663](https://github.com/rectorphp/rector-src/pull/4663)) - Resolve encapsed values as strings ([#&#8203;4622](https://github.com/rectorphp/rector-src/pull/4622)), Thanks [@&#8203;Bellardia](https://github.com/Bellardia)! - \[Privatization] Skip parent class unknown on PrivatizeFinalClassMethodRector ([#&#8203;4671](https://github.com/rectorphp/rector-src/pull/4671)) - \[TypeDeclaration] Skip anonymous class and other object on ReturnUnionTypeRector ([#&#8203;4670](https://github.com/rectorphp/rector-src/pull/4670)) - \[TypeDeclaration] Allow return anonymous class on ReturnTypeFromReturnNewRector ([#&#8203;4669](https://github.com/rectorphp/rector-src/pull/4669)) - \[TypeDeclaration]\[CodeQuality] Move ReturnTypeFromStrictScalarReturnExprRector from CodeQuality to TypeDeclaration set ([#&#8203;4668](https://github.com/rectorphp/rector-src/pull/4668)) - \[TypeDeclaration] Allow \_\_invoke() method for return type changed on ClassMethodReturnTypeOverrideGuard ([#&#8203;4667](https://github.com/rectorphp/rector-src/pull/4667)) - \[NodeTypeResolver] Clean up anonymous class detection on NodeTypeResolver::getNativeType() ([#&#8203;4673](https://github.com/rectorphp/rector-src/pull/4673)) - \[NodeAnalyzer] Pass ReflectionProvider to \_\_construct() on CallAnalyzer ([#&#8203;4699](https://github.com/rectorphp/rector-src/pull/4699)) - Skip code changes on unresolvable/unknown classes ([#&#8203;4619](https://github.com/rectorphp/rector-src/pull/4619)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[TypeDeclaration] Use return bool for ParentClassMethodTypeOverrideGuard::hasParentClassMethod(), return ?MethodReflection for ParentClassMethodTypeOverrideGuard::getParentClassMethod() ([#&#8203;4703](https://github.com/rectorphp/rector-src/pull/4703)) - \[TypeDeclaration] Skip param setter method intersection docblock not autoload on ReturnNeverTypeRector ([#&#8203;4721](https://github.com/rectorphp/rector-src/pull/4721)) - \[TypeDeclaration] Skip non void or never already return typed on ReturnNeverTypeRector ([#&#8203;4723](https://github.com/rectorphp/rector-src/pull/4723)) - Make relativeFilePathFromDirectory() private as used only locally ([#&#8203;4735](https://github.com/rectorphp/rector-src/pull/4735)) - \[DX] Avoid supporting edge-case multi-layered comments, must be covered in php-parser itself ([#&#8203;4743](https://github.com/rectorphp/rector-src/pull/4743)) - \[TypeDeclaration] Skip void type on caller on ReturnTypeFromStrictTypedCallRector ([#&#8203;4751](https://github.com/rectorphp/rector-src/pull/4751)) - Use direct VoidType definition on Return\_ expr is null on ReturnedNodesReturnTypeInfererTypeInferer ([#&#8203;4752](https://github.com/rectorphp/rector-src/pull/4752)) - \[Renaming] Deprecate PseudoNamespaceToNamespaceRector as too dynamic and unreliable, use the RenameClassRector instead ([#&#8203;4755](https://github.com/rectorphp/rector-src/pull/4755)) <br> #### Removed :skull: Since Rector 0.15 we declare type stricness and avoid docblock changes, as unreliable and could lead to incorrect assumptions: [getrector.com/blog/new-in-rector-015-complete-safe-and-known-type-declarations](https://getrector.com/blog/new-in-rector-015-complete-safe-and-known-type-declarations) Few rules work with unreliable docblocks, and were removed. Instead handle cases yourself with PHPStan help 👍 - \[DX] Remove deprecated RectorConfigProvider, use SimpleParameterProvider instead ([#&#8203;4658](https://github.com/rectorphp/rector-src/pull/4658)) - \[DX] Remove usage of deprecated symfony parameters ([#&#8203;4674](https://github.com/rectorphp/rector-src/pull/4674)) - Remove deprecated ArrayShapeFromConstantArrayReturnRector ([#&#8203;4662](https://github.com/rectorphp/rector-src/pull/4662)) - Remove RemoveParentRector as never used and only for demo purposes, handle custom way where needed ([#&#8203;4679](https://github.com/rectorphp/rector-src/pull/4679)) - \[DX] Remove \*AnnotationIncorrectNullableRector rules as works with unreliable docblocks and can have 2 solutions ([#&#8203;4719](https://github.com/rectorphp/rector-src/pull/4719)) - Remove appendArgs() method on AbstractRector ([#&#8203;4732](https://github.com/rectorphp/rector-src/pull/4732)) - \[Renaming] Remove callables from class renames to avoid missed rename bugs, better handle with PHSPtan and custom rule ([#&#8203;4745](https://github.com/rectorphp/rector-src/pull/4745)) - \[DX] Remove NullifyUnionNullableRector, let cs tools handle it ([#&#8203;4660](https://github.com/rectorphp/rector-src/pull/4660)) - \[DX] Remove RemoveJustPropertyFetchRector as used for one time job, not practical for general use ([#&#8203;4661](https://github.com/rectorphp/rector-src/pull/4661)) - \[TypeDeclaration] Remove AddClosureReturnTypeRector ([#&#8203;4637](https://github.com/rectorphp/rector-src/pull/4637)) - \[DX] Remove AddDefaultValueForUndefinedVariableRector as can generate broken code and depends on context ([#&#8203;4729](https://github.com/rectorphp/rector-src/pull/4729)) ### [`v0.17.10`](https://github.com/rectorphp/rector/releases/tag/0.17.10): Released Rector 0.17.10 [Compare Source](https://github.com/rectorphp/rector/compare/0.17.9...0.17.10) #### New Features :partying\_face: - \[TypeDeclaration] Add Closure support on NumericReturnTypeFromStrictScalarReturnsRector ([#&#8203;4631](https://github.com/rectorphp/rector-src/pull/4631)) - \[TypeDeclaration] Add Closure support on StrictArrayParamDimFetchRector ([#&#8203;4632](https://github.com/rectorphp/rector-src/pull/4632)) - \[TypeDeclaration] Add Closure support on ReturnTypeFromStrictParamRector ([#&#8203;4633](https://github.com/rectorphp/rector-src/pull/4633)) - \[TypeDeclaration] Add Closure support on StrictStringParamConcatRector ([#&#8203;4634](https://github.com/rectorphp/rector-src/pull/4634)) <br> #### Bugfixes :bug: - \[Downgrade] \[FIX] Fix infinite loop in DowngradeArrayFilterNullableCallbackRector ([#&#8203;150](https://github.com/rectorphp/rector-downgrade-php/pull/150)) ### [`v0.17.9`](https://github.com/rectorphp/rector/releases/tag/0.17.9): Released Rector 0.17.9 [Compare Source](https://github.com/rectorphp/rector/compare/0.17.8...0.17.9) #### Bugfixes :bug: - Fix last arg trailing comma removal DowngradeTrailingCommasInFunctionCallsRector - [rectorphp/rector-downgrade-php@`059d483`](https://github.com/rectorphp/rector-downgrade-php/commit/059d48366ee50115006a8d26ede574d70da724d2) ### [`v0.17.8`](https://github.com/rectorphp/rector/releases/tag/0.17.8): Released Rector 0.17.8 [Compare Source](https://github.com/rectorphp/rector/compare/0.17.7...0.17.8) #### New Features :partying\_face: - \[TypeDeclaration] Add Closure support on BoolReturnTypeFromStrictScalarReturnsRector ([#&#8203;4610](https://github.com/rectorphp/rector-src/pull/4610)) - AddMethodCallBasedStrictParamTypeRector: Support changing protected methods in final classes ([#&#8203;4611](https://github.com/rectorphp/rector-src/pull/4611)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[TypeDeclaration] Add StrictStringParamConcatRector ([#&#8203;4624](https://github.com/rectorphp/rector-src/pull/4624)) <br> #### Bugfixes :bug: - \[PHPStanStaticTypeMapper] FQCN for Closure type mapper ([#&#8203;4584](https://github.com/rectorphp/rector-src/pull/4584)) - Fixed constant types handling in TypedPropertyFromStrictConstructorRector ([#&#8203;4588](https://github.com/rectorphp/rector-src/pull/4588)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[TypeDeclaration] Skip coalesce on StrictArrayParamDimFetchRector ([#&#8203;4589](https://github.com/rectorphp/rector-src/pull/4589)) - Bump to phpdoc-parser 1.23 and fill construct() attributes ([#&#8203;4590](https://github.com/rectorphp/rector-src/pull/4590)) - \[TypeDeclaration] Skip override string on StrictArrayParamDimFetchRector ([#&#8203;4591](https://github.com/rectorphp/rector-src/pull/4591)) - \[Autoloading] Using SimpleParameterProvider on BootstrapFilesIncluder ([#&#8203;4592](https://github.com/rectorphp/rector-src/pull/4592)) - \[Php81] Fix regression skip call by ref on ReadOnlyPropertyRector ([#&#8203;4593](https://github.com/rectorphp/rector-src/pull/4593)) - \[PHPStanStaticTypeMapper] Make use of toPhpDocNode() on ObjectTypeMapper ([#&#8203;4581](https://github.com/rectorphp/rector-src/pull/4581)) - \[PHPStanStaticTypeMapper] Fix IntersectionTypeMapper to make ObjectType have FQCN ([#&#8203;4598](https://github.com/rectorphp/rector-src/pull/4598)) - \[Php81] Skip re-assign with AssignOp on ReadOnlyPropertyRector ([#&#8203;4600](https://github.com/rectorphp/rector-src/pull/4600)) - Reduce ConstExprClassNameDecorator overhead ([#&#8203;4603](https://github.com/rectorphp/rector-src/pull/4603)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Resolve native return-type from native union-type in short ternary ([#&#8203;4606](https://github.com/rectorphp/rector-src/pull/4606)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[Strict] Skip from docblock [@&#8203;return](https://github.com/return) on DisallowedEmptyRuleFixerRector ([#&#8203;4608](https://github.com/rectorphp/rector-src/pull/4608)) - \[Strict] Skip [@&#8203;return](https://github.com/return) docblock on BooleanInIfConditionRuleFixerRector ([#&#8203;4609](https://github.com/rectorphp/rector-src/pull/4609)) - \[Php81] Fix regression skip call by ref on ReadOnlyPropertyRector on non \_\_construct method ([#&#8203;4614](https://github.com/rectorphp/rector-src/pull/4614)) - \[CodeQuality]\[Strict] Handle infinite loop on SimplifyDeMorganBinaryRector+SimplifyIfReturnBoolRector+DisallowedEmptyRuleFixerRector ([#&#8203;4615](https://github.com/rectorphp/rector-src/pull/4615)) - \[CodingStyle]\[Namespace\_] Support constant imports ([#&#8203;4612](https://github.com/rectorphp/rector-src/pull/4612)), Thanks [@&#8203;natepage](https://github.com/natepage)! - \[Php81] Skip property fetch from new static on ReadOnlyPropertyRector ([#&#8203;4617](https://github.com/rectorphp/rector-src/pull/4617)) - \[CodingStyle] Handle crash on empty cases on BinarySwitchToIfElseRector ([#&#8203;4618](https://github.com/rectorphp/rector-src/pull/4618)) - Fix string type on StrictArrayParamDimFetchRector ([#&#8203;4623](https://github.com/rectorphp/rector-src/pull/4623)) - \[PHPStanStaticTypeMapper] Handle crash on DowngradeMixedTypeDeclarationRector for PHPStan\Type\ConditionalType ([#&#8203;4625](https://github.com/rectorphp/rector-src/pull/4625)) - \[Php73] Handle crash Type Error on JsonThrowOnErrorRector ([#&#8203;4626](https://github.com/rectorphp/rector-src/pull/4626)) - \[Php81] Skip call by ref on ReadOnlyPropertyRector on FuncCall ([#&#8203;4630](https://github.com/rectorphp/rector-src/pull/4630)) - \[Printer] Fix printing PHPStan AlwaysRememberedExpr with add unwrapper inside BetterStandardPrinter::p ([#&#8203;4629](https://github.com/rectorphp/rector-src/pull/4629)) - \[TypeDeclaration] Skip has parent class method on AddParamTypeFromPropertyTypeRector ([#&#8203;4627](https://github.com/rectorphp/rector-src/pull/4627)) <br> #### Removed :skull: - \[Printer] Remove has InlineHTML node check after apply changes on PhpFileProcessor ([#&#8203;4601](https://github.com/rectorphp/rector-src/pull/4601)) ### [`v0.17.7`](https://github.com/rectorphp/rector/releases/tag/0.17.7): Released Rector 0.17.7 [Compare Source](https://github.com/rectorphp/rector/compare/0.17.6...0.17.7) #### New Features :partying\_face: - \[CodingStyle] Skip filled by construct on AddArrayDefaultToArrayPropertyRector ([#&#8203;4549](https://github.com/rectorphp/rector-src/pull/4549)) - Add constuctor support to ReplaceArgumentDefaultValueRector ([#&#8203;4554](https://github.com/rectorphp/rector-src/pull/4554)) - StaticMapper: added fast path for IdentifierTypeNode ([#&#8203;4565](https://github.com/rectorphp/rector-src/pull/4565)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Add ReturnTypeFromStrictParamRector ([#&#8203;4501](https://github.com/rectorphp/rector-src/pull/4501)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Add TypedPropertyFromStrictConstructorReadonlyClassRector ([#&#8203;4552](https://github.com/rectorphp/rector-src/pull/4552)), Thanks [@&#8203;staabm](https://github.com/staabm)! - ReturnTypeFromStrictTernaryRector: Support complex ternaries ([#&#8203;4515](https://github.com/rectorphp/rector-src/pull/4515)), Thanks [@&#8203;staabm](https://github.com/staabm)! #### Bugfixes :bug: - Support final methods in ClassMethodReturnTypeOverrideGuard ([#&#8203;4509](https://github.com/rectorphp/rector-src/pull/4509)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Support literals in ReturnTypeFromStrictTypedCallRector ([#&#8203;4511](https://github.com/rectorphp/rector-src/pull/4511)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[TypeDeclaration] Null stmts check early on ReturnTypeFromStrictParamRector ([#&#8203;4512](https://github.com/rectorphp/rector-src/pull/4512)) - \[Performance] Use filtered filePaths from ApplicationFileProcessor::configurePHPStanNodeScopeResolver on WorkerRunner::run() ([#&#8203;4513](https://github.com/rectorphp/rector-src/pull/4513)) - \[DX] Show progress bar 100% on RectorConsoleOutputFormatter::report() ([#&#8203;4516](https://github.com/rectorphp/rector-src/pull/4516)) - \[ChangesReporting] Reuse defined errors vairable on ConsoleOutputFormatter ([#&#8203;4517](https://github.com/rectorphp/rector-src/pull/4517)) - \[ApplicationFileProcessor] Refactor ApplicationFileProcessor to filter file paths early before run both parallel and non-parallel ([#&#8203;4519](https://github.com/rectorphp/rector-src/pull/4519)) - \[DX] Fix hang on twice run after all files processed cached ([#&#8203;4521](https://github.com/rectorphp/rector-src/pull/4521)) - \[Application] Move filter files by config extensions to FileFactory ([#&#8203;4522](https://github.com/rectorphp/rector-src/pull/4522)) - \[Php81]\[Php82]\[Privatization] Handle extends non-readonly class on ReadOnlyPropertyRector+ReadOnlyClassRector+FinalizeClassesWithoutChildrenRector ([#&#8203;4524](https://github.com/rectorphp/rector-src/pull/4524)) - Fix wrong results in RemoveAlwaysElseRector ([#&#8203;4527](https://github.com/rectorphp/rector-src/pull/4527)), Thanks [@&#8203;jlherren](https://github.com/jlherren)! - Support class-const-fetch in ReturnTypeFromStrictTypedCallRector ([#&#8203;4520](https://github.com/rectorphp/rector-src/pull/4520)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[EarlyReturn] Skip append variable on PreparedValueToEarlyReturnRector ([#&#8203;4530](https://github.com/rectorphp/rector-src/pull/4530)) - Refactor MyCLabs\Enum\Enum::equals calls to comparisons ([#&#8203;4532](https://github.com/rectorphp/rector-src/pull/4532)), Thanks [@&#8203;rojtjo](https://github.com/rojtjo)! - \[Performance]\[NodeManipulator] Avoid loop on search first variable named on next sliced next stmts on StmtsManipulator ([#&#8203;4537](https://github.com/rectorphp/rector-src/pull/4537)) - \[Performance] \[TypeDeclaration] Reduce resolve ClassReflection on each property on TypedPropertyFromStrictConstructorRector ([#&#8203;4536](https://github.com/rectorphp/rector-src/pull/4536)) - \[Performance]\[TypeDeclaration] Reduce resolve ClassReflection from Property on AllAssignNodePropertyTypeInferer ([#&#8203;4539](https://github.com/rectorphp/rector-src/pull/4539)) - \[Application] Merge process files on both parallel and non-parallel process ([#&#8203;4523](https://github.com/rectorphp/rector-src/pull/4523)) - \[PHPStan] Merge assert phpstan errors to one ([#&#8203;4544](https://github.com/rectorphp/rector-src/pull/4544)) - \[Performance] \[Php74] Reduce ClassReflection lookup from property on PropertyTypeChangeGuard ([#&#8203;4545](https://github.com/rectorphp/rector-src/pull/4545)) - Use instanceof check on ClassReflection resolve ([#&#8203;4547](https://github.com/rectorphp/rector-src/pull/4547)) - \[Reflection] Reduce Scope pulling on ReflectionResolver ([#&#8203;4548](https://github.com/rectorphp/rector-src/pull/4548)) - \[Strict] Skip empty() from param doc on DisallowedEmptyRuleFixerRector ([#&#8203;4550](https://github.com/rectorphp/rector-src/pull/4550)) - Fix space in paths ([#&#8203;4553](https://github.com/rectorphp/rector-src/pull/4553)) - Skip traits in CountOnNullRector ([#&#8203;4556](https://github.com/rectorphp/rector-src/pull/4556)) - Make use of toPhpDocNode() - take [#&#8203;2](https://github.com/rectorphp/rector/issues/2) ([#&#8203;4555](https://github.com/rectorphp/rector-src/pull/4555)) - \[Performance] \[PostRector] Only check phpdocinfo on Stmt and Param on NameImportingPostRector ([#&#8203;4558](https://github.com/rectorphp/rector-src/pull/4558)) - \[CodeQuality] Skip pull property from inner class on CompleteDynamicPropertiesRector ([#&#8203;4561](https://github.com/rectorphp/rector-src/pull/4561)) - Prevent unnecessary scope creation ([#&#8203;4562](https://github.com/rectorphp/rector-src/pull/4562)), Thanks [@&#8203;staabm](https://github.com/staabm)! - NameImportingPhpDocNodeVisitor: Cheap checks first ([#&#8203;4563](https://github.com/rectorphp/rector-src/pull/4563)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[Performance]\[Renaming] No need PhpDocInfo refactor on Name node on ClassRenamer ([#&#8203;4566](https://github.com/rectorphp/rector-src/pull/4566)) - \[TypeDeclaration] Deprecate ArrayShapeFromConstantArrayReturnRector as uses docblocks that we move away from since 0.15 ([#&#8203;4571](https://github.com/rectorphp/rector-src/pull/4571)) - Make ReturnTypeFromStrictNewArrayRector handle only single level arrays ([#&#8203;4575](https://github.com/rectorphp/rector-src/pull/4575)) - Fix array mapping ([#&#8203;4576](https://github.com/rectorphp/rector-src/pull/4576)) - \[Performance] \[PostRector] Reduce repetitive resolve uses statements on NameImportingPostRector ([#&#8203;4579](https://github.com/rectorphp/rector-src/pull/4579)) - \[EarlyReturn] Handle multiple statements in else in ChangeIfElseValueAssignToEarlyReturnRector ([#&#8203;4580](https://github.com/rectorphp/rector-src/pull/4580)), Thanks [@&#8203;dorrogeray](https://github.com/dorrogeray)! - \[BUGFIX] Ensure proper reprint with attributes for finalized classes ([#&#8203;4585](https://github.com/rectorphp/rector-src/pull/4585)), Thanks [@&#8203;cngJo](https://github.com/cngJo)! <br> #### Removed :skull: - \[DX] Remove AllowEmptyConfigurableRectorInterface to ease interface tree, better handle on particular configure() method inside the rule ([#&#8203;4540](https://github.com/rectorphp/rector-src/pull/4540)) - Skip description on same line, remove on next line as based on phpdoc-parser in RemoveUselessParamTagRector ([#&#8203;4551](https://github.com/rectorphp/rector-src/pull/4551)) - \[Performance]\[PostRector] Remove alias exists check on NameImporter called from NameImportingPostRector ([#&#8203;4564](https://github.com/rectorphp/rector-src/pull/4564)) - \[Performance]\[BetterPhpDocParser] Remove unused ConstExprNode check on ConstExprClassNameDecorator ([#&#8203;4578](https://github.com/rectorphp/rector-src/pull/4578)) - \[PHPStanStaticTypeMapper] Remove manual type check on PHPStanStaticTypeMapper ([#&#8203;4583](https://github.com/rectorphp/rector-src/pull/4583)) - \[StaticTypeMapper] Remove standalone false handling on StaticTypeMapper ([#&#8203;4582](https://github.com/rectorphp/rector-src/pull/4582)) ### [`v0.17.6`](https://github.com/rectorphp/rector/releases/tag/0.17.6): Released Rector 0.17.6 [Compare Source](https://github.com/rectorphp/rector/compare/0.17.5...0.17.6) In this release, we narrowed rules from PHPUit and Doctrine to their specific version category. We've detected few outdated and never used rules and cleaned them up to make Rector smaller and easier to use :+1: Be use to always use `*SetList` constants over specific rules to use the latest version: ```php use Rector\Config\RectorConfig; return static function (RectorConfig $rectorConfig): void { $rectorConfig->sets([ \Rector\PHPUnit\Set\PHPUnitLevelSetList::UP_TO_PHPUNIT_100, ]); }; ``` #### New Features :partying\_face: - Add PHPUnit to sets ([#&#8203;4495](https://github.com/rectorphp/rector-src/pull/4495)) - \[CI] Add PHPUnit 10 to check rules and sets groups ([#&#8203;4500](https://github.com/rectorphp/rector-src/pull/4500)) - \[CI] Add doctrine rules in set check ([#&#8203;4505](https://github.com/rectorphp/rector-src/pull/4505)) <br> #### Bugfixes :bug: - \[Performance] Only set Attribute on context inside ArrayDimFetch and ArrayItem on specific node used ([#&#8203;4493](https://github.com/rectorphp/rector-src/pull/4493)) - \[Php52] Use instanceof check instead of compare object $newStmt === $caseStmt on ContinueToBreakInSwitchRector ([#&#8203;4494](https://github.com/rectorphp/rector-src/pull/4494)) - Exclude the full docs folder from archives ([#&#8203;4497](https://github.com/rectorphp/rector-src/pull/4497)), Thanks [@&#8203;stof](https://github.com/stof)! - Cleanup RecastingRemovalRector tests ([#&#8203;4498](https://github.com/rectorphp/rector-src/pull/4498)) - Move Rector order test to PHPUnit, as uses its rules ([#&#8203;4499](https://github.com/rectorphp/rector-src/pull/4499)) - let phpunit handle its own empty method rule ([#&#8203;4501](https://github.com/rectorphp/rector-src/pull/4501)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Micro optimizations: cheap checks first ([#&#8203;4510](https://github.com/rectorphp/rector-src/pull/4510)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Skip coalsce assign in RemoveUnusedPrivatePropertyRector ([#&#8203;4491](https://github.com/rectorphp/rector-src/pull/4491)) - \[DeadCode] Skip append += assignment on RemoveUnusedPrivatePropertyRector ([#&#8203;4506](https://github.com/rectorphp/rector-src/pull/4506)) - \[AstResolver]\[Performance] Remove unnecessary double File read on AstResolver::parseFileNameToDecoratedNodes() ([#&#8203;4508](https://github.com/rectorphp/rector-src/pull/4508)) <br> #### Removed :skull: - \[NodeTypeResolver] Remove unused AttributeKey::INSIDE\_ARRAY\_ITEM on ContextNodeVisitor ([#&#8203;4496](https://github.com/rectorphp/rector-src/pull/4496)) - \[NodeTypeResolver] Remove AttributeKey::IS\_RETURN\_EXPR from ContextNodeVisitor ([#&#8203;4502](https://github.com/rectorphp/rector-src/pull/4502)) - \[NodeTypeResolver] Remove AttributeKey::IS\_ISSET\_VAR from ContextNodeVisitor ([#&#8203;4503](https://github.com/rectorphp/rector-src/pull/4503)) - \[NodeTypeResolver] Remove nestedChainMethodCallLimit() for deep method call counter check ([#&#8203;4504](https://github.com/rectorphp/rector-src/pull/4504)) ### [`v0.17.5`](https://github.com/rectorphp/rector/releases/tag/0.17.5): Released Rector 0.17.5 [Compare Source](https://github.com/rectorphp/rector/compare/0.17.4...0.17.5) #### Removed :skull: - \[DeadCode] Skip property not exists on RemoveTypedPropertyDeadInstanceOfRector ([#&#8203;4481](https://github.com/rectorphp/rector-src/pull/4481)) - \[CodeQuality]\[Php80] Handle infite loop swap params on RemoveUnusedVariableInCatchRector + OptionalParametersAfterRequiredRector ([#&#8203;4484](https://github.com/rectorphp/rector-src/pull/4484)) <br> #### Bugfixes :bug: - fix(rules): Skip readonly classes from restoring default null value. ([#&#8203;4479](https://github.com/rectorphp/rector-src/pull/4479)), Thanks [@&#8203;scyzoryck](https://github.com/scyzoryck)! - \[Php80] Handle crash on ClassOnObjectRector + GetDebugTypeRector ([#&#8203;4483](https://github.com/rectorphp/rector-src/pull/4483)) - \[Strict] Fix DisallowedEmptyRuleFixerRector on empty string isset ([#&#8203;4485](https://github.com/rectorphp/rector-src/pull/4485)) - Fix StrictArrayParamDimFetchRector on `is_*` calls ([#&#8203;4486](https://github.com/rectorphp/rector-src/pull/4486)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Fix trait rename in Php4ConsturctorRector ([#&#8203;4487](https://github.com/rectorphp/rector-src/pull/4487)) - Fix StrictArrayParamDimFetchRector on same named property ([#&#8203;4488](https://github.com/rectorphp/rector-src/pull/4488)), Thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v0.17.4`](https://github.com/rectorphp/rector/releases/tag/0.17.4): Released Rector 0.17.4 [Compare Source](https://github.com/rectorphp/rector/compare/0.17.3...0.17.4) #### Bugfixes :bug: - \[CodeQuality]\[EarlyReturn] Handle crash Replace Stmt to Expr on FlipTypeControlToUseExclusiveTypeRector+FlipTypeControlToUseExclusiveTypeRector+ReturnBinaryOrToEarlyReturnRector ([#&#8203;4474](https://github.com/rectorphp/rector-src/pull/4474)) - Fix ReturnBinaryOrToEarlyReturnRector mixing up returned nodes of array, hook into StmtsAwareInterface instead to keep next Rector rules updated ([#&#8203;4476](https://github.com/rectorphp/rector-src/pull/4476)) <br> #### Removed :skull: - Remove duplicated version\_compare ReplaceFuncCallArgumentDefaultValue rule ([#&#8203;4473](https://github.com/rectorphp/rector-src/pull/4473)), Thanks [@&#8203;alexander-schranz](https://github.com/alexander-schranz)! - \[EarlyReturn] Remove ReturnBinaryAndToEarlyReturnRector as creates code hard to read and flips condition ([#&#8203;4478](https://github.com/rectorphp/rector-src/pull/4478)) ### [`v0.17.3`](https://github.com/rectorphp/rector/releases/tag/0.17.3): Released Rector 0.17.3 [Compare Source](https://github.com/rectorphp/rector/compare/0.17.2...0.17.3) In this release we continue preparing for Rector 1.0 release [#&#8203;7854](https://github.com/rectorphp/rector/issues/7854) This includes **removing last parent node** connections, to lower node tree memory consumption 🥳️🥳️🥳️ - \[EarlyReturn] Remove findFirstNext() on InvertedIfFactory ([#&#8203;4399](https://github.com/rectorphp/rector-src/pull/4399)) - \[DX] Remove findParentType() method ([#&#8203;4438](https://github.com/rectorphp/rector-src/pull/4438)) - \[DX] Remove parent node from AbstractRector ([#&#8203;4465](https://github.com/rectorphp/rector-src/pull/4465)) <br> #### New Features :partying_face: - Add float mul integer type to NumericReturnTypeFromStrictScalarReturnsRector ([#&#8203;4376](https://github.com/rectorphp/rector-src/pull/4376)) - \[TypeDeclaration] Add Encapsed string support to AlwaysStrictScalarExprAnalyzer ([#&#8203;4382](https://github.com/rectorphp/rector-src/pull/4382)) - \[TypeDeclaration] Add StrictArrayParamDimFetchRector ([#&#8203;4384](https://github.com/rectorphp/rector-src/pull/4384)) - \[DX] Kick of SimpleParameterProvider ([#&#8203;4405](https://github.com/rectorphp/rector-src/pull/4405)) <br> #### Bugfixes :bug: - \[DeadCode] Skip non typed param numeric check on RecastingRemovalRector ([#&#8203;4390](https://github.com/rectorphp/rector-src/pull/4390)) - \[Renaming] Handle crash on catch Exception name on RenameClassRector ([#&#8203;4401](https://github.com/rectorphp/rector-src/pull/4401)) - Fix NumericReturnTypeFromStrictScalarReturnsRector for non-natively-typed parameters ([#&#8203;4380](https://github.com/rectorphp/rector-src/pull/4380)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[Php82] Skip extends unknown class on ReadonlyClassRector ([#&#8203;4408](https://github.com/rectorphp/rector-src/pull/4408)) - \[TypeDeclaration] Handle crash on no namespace with + operation on DeclareStrictTypesRector ([#&#8203;4414](https://github.com/rectorphp/rector-src/pull/4414)) - \[NodeTypeResolver] Reduce duplicated Scope fill on FuncCall ([#&#8203;4428](https://github.com/rectorphp/rector-src/pull/4428)) - Make JsonThrowOnErrorRector work with local scope to detect error\_json methods ([#&#8203;4451](https://github.com/rectorphp/rector-src/pull/4451)) - Deprecate resolveNextNode() to work only in current node tree context ([#&#8203;4455](https://github.com/rectorphp/rector-src/pull/4455)) - \[Naming] Skip used on next foreach on RenameForeachValueVariableToMatchExprVariableRector ([#&#8203;4469](https://github.com/rectorphp/rector-src/pull/4469)) <br> #### Removed :skull: - Remove duplicate ReturnNeverTypeRector rule ([#&#8203;4381](https://github.com/rectorphp/rector-src/pull/4381)), Thanks [@&#8203;buffcode](https://github.com/buffcode)! - \[MysqlToMysqli] Deprecate set, as dangerous to use, better handle manually ([#&#8203;4448](https://github.com/rectorphp/rector-src/pull/4448)) - \[DX] Make use of SimpleParameterProvider directly, deprecate RectorConfigProvider ([#&#8203;4460](https://github.com/rectorphp/rector-src/pull/4460)) - \[Performance] Immediate remove UnreachableStatementNodeVisitor object after traverse to avoid re-use in next file ([#&#8203;4417](https://github.com/rectorphp/rector-src/pull/4417)) - \[NodeTypeResolver] Remove ArrayItem scope filling from Array\_ and Name filling for Catch types on PHPStanNodeScopeResolver ([#&#8203;4423](https://github.com/rectorphp/rector-src/pull/4423)) - \[PHP 8] Resources object upgrade - remove 2 rules as the upgrade require wholesome manual work ([#&#8203;4442](https://github.com/rectorphp/rector-src/pull/4442)) - \[DeadCode] Remove RemoveJustVariableAssignRector as often done on purpose or with side effect ([#&#8203;4450](https://github.com/rectorphp/rector-src/pull/4450)) - Remove deprecated resolveNextNode() to embrace local scope node ([#&#8203;4456](https://github.com/rectorphp/rector-src/pull/4456)) - \[DX] Remove node connecting traverser from AbstractRector ([#&#8203;4463](https://github.com/rectorphp/rector-src/pull/4463)) - Remove NodeConnectingTraverser ([#&#8203;4464](https://github.com/rectorphp/rector-src/pull/4464)) - \[DX] Remove autowrapping of expr/stmt to make return values in the same type and reliable ([#&#8203;4466](https://github.com/rectorphp/rector-src/pull/4466)) ### [`v0.17.2`](https://github.com/rectorphp/rector/releases/tag/0.17.2): Released Rector 0.17.2 [Compare Source](https://github.com/rectorphp/rector/compare/0.17.1...0.17.2) In this release we continue preparing for Rector 1.0 release [#&#8203;7854](https://github.com/rectorphp/rector/issues/7854) This includes: - removing more parent node connections, to lower node tree memory consumption <br> #### New Features :partying_face: - Add sleep after processPool->quitAll() to give time for all child processes to terminate ([#&#8203;4280](https://github.com/rectorphp/rector-src/pull/4280)), Thanks [@&#8203;dorrogeray](https://github.com/dorrogeray)! - \[TypeDeclaration] Add NumericReturnTypeFromStrictScalarReturnsRector ([#&#8203;4296](https://github.com/rectorphp/rector-src/pull/4296)) - \[Php71] Add Closure support on AssignArrayToStringRector ([#&#8203;4303](https://github.com/rectorphp/rector-src/pull/4303)) - Introduces `AddSensitiveParameterAttributeRector` rule ([#&#8203;4342](https://github.com/rectorphp/rector-src/pull/4342)), Thanks [@&#8203;peterfox](https://github.com/peterfox)! - Bump nikic/php-parser to 4.16.0 ([#&#8203;4343](https://github.com/rectorphp/rector-src/pull/4343)) - Show error when no files will be processed ([#&#8203;4326](https://github.com/rectorphp/rector-src/pull/4326)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Cache unchanged files on dry run v2 ([#&#8203;4281](https://github.com/rectorphp/rector-src/pull/4281)), Thanks [@&#8203;dorrogeray](https://github.com/dorrogeray)! <br> #### Bugfixes :bug: - \[CodeQuality] Handle crash on variable variable on OptionalParametersAfterRequiredRector ([#&#8203;4226](https://github.com/rectorphp/rector-src/pull/4226)) - Fix LocallyCalledStaticMethodToNonStaticRector with method args ([#&#8203;4233](https://github.com/rectorphp/rector-src/pull/4233)), Thanks [@&#8203;toastedghost](https://github.com/toastedghost)! - Use `FunctionLike` contract instead of union of function-like concrete implementations ([#&#8203;4241](https://github.com/rectorphp/rector-src/pull/4241)), Thanks [@&#8203;Wirone](https://github.com/Wirone)! - \[CodeQuality]\[Performance] Reduce repetitive NodeTypeResolver->getType() on ExprBoolCaster ([#&#8203;4279](https://github.com/rectorphp/rector-src/pull/4279)) - Skip rewindable generator ([#&#8203;4282](https://github.com/rectorphp/rector-src/pull/4282)) - \[Php55]\[NodeTypeResolver] Handle crash on dynamic variable concat assign on StringClassNameToClassConstantRector ([#&#8203;4283](https://github.com/rectorphp/rector-src/pull/4283)) - \[Php55] Clean up FullyQualified assigned to FullyQualified on StringClassNameToClassConstantRector ([#&#8203;4284](https://github.com/rectorphp/rector-src/pull/4284)) - \[TypeDeclaration] Extend NumericReturnTypeFromStrictScalarReturnsRector ([#&#8203;4297](https://github.com/rectorphp/rector-src/pull/4297)) - Skip divide in NumericReturnTypeFromStrictScalarReturnsRector ([#&#8203;4298](https://github.com/rectorphp/rector-src/pull/4298)) - \[TypeDeclaration] Skip once typed and else return array\_map() on ReturnTypeFromStrictTypedCallRector ([#&#8203;4312](https://github.com/rectorphp/rector-src/pull/4312)) - Fix command to configure rector ([#&#8203;4314](https://github.com/rectorphp/rector-src/pull/4314)), Thanks [@&#8203;bertramakers](https://github.com/bertramakers)! - \[Performance] \[NodeTypeResolver] Reduce callable traverse usage on ContextNodeVisitor ([#&#8203;4317](https://github.com/rectorphp/rector-src/pull/4317)) - \[CodeQuality] Skip not regex on SimplifyRegexPatternRector ([#&#8203;4322](https://github.com/rectorphp/rector-src/pull/4322)) - \[TypeDeclaration] Handle crash on object shape on ArrayShapeFromConstantArrayReturnRector ([#&#8203;4323](https://github.com/rectorphp/rector-src/pull/4323)) - \[Php81] Skip named constructor on ReadOnlyPropertyRector ([#&#8203;4359](https://github.com/rectorphp/rector-src/pull/4359)) - Skip argument if value equals default value ([#&#8203;4368](https://github.com/rectorphp/rector-src/pull/4368)), Thanks [@&#8203;stefantalen](https://github.com/stefantalen)! - \[MysqlToMysqli] Handle infinite loop on MysqlQueryMysqlErrorWithLinkRector when no connection instance on first dept stmt ([#&#8203;4375](https://github.com/rectorphp/rector-src/pull/4375)) <br> #### Removed :skull: - Remove `removeNode()` method from AbstractRector ([#&#8203;4225](https://github.com/rectorphp/rector-src/pull/4225)) - Remove Kind from doc mapper, as used just once ([#&#8203;4234](https://github.com/rectorphp/rector-src/pull/4234)) - Move LocallyCalledStaticMethodToNonStaticRector to CodeQuality namespace, to avoid dumping removed static set ([#&#8203;4242](https://github.com/rectorphp/rector-src/pull/4242)) - Restore RemoveMethodCallParamRector as used ([#&#8203;4244](https://github.com/rectorphp/rector-src/pull/4244)) - \[Performance] Remove NODES\_TO\_MATCH constant on RemoveNonExistingVarAnnotationRector ([#&#8203;4267](https://github.com/rectorphp/rector-src/pull/4267)) - Remove VarConstantCommentRector as using unreliable docblocks, better use upcoming PHP 8.3 strict type const ([#&#8203;4307](https://github.com/rectorphp/rector-src/pull/4307)) - \[Naming] Remove BreakingVariableRenameGuard::isUsedInIfAndOtherBranches() to remove previous by types ([#&#8203;4319](https://github.com/rectorphp/rector-src/pull/4319)) - \[Php81] Remove cast check on NullToStrictStringFuncCallArgRector ([#&#8203;4320](https://github.com/rectorphp/rector-src/pull/4320)) - \[PhpParser] Remove BetterNodeFinder::findFirstPreviousOfTypes() ([#&#8203;4327](https://github.com/rectorphp/rector-src/pull/4327)) - Move AddMethodParentCallRector to Symfony Rector ([#&#8203;4301](https://github.com/rectorphp/rector-src/pull/4301)) ### [`v0.17.1`](https://github.com/rectorphp/rector/releases/tag/0.17.1): Released Rector 0.17.1 [Compare Source](https://github.com/rectorphp/rector/compare/0.17.0...0.17.1) In this release we continue preparing for Rector 1.0 release [#&#8203;7854](https://github.com/rectorphp/rector/issues/7854) This includes: - removing more parent node connections, to lower node tree memory consumption - replacing `removeNode()` method with `return NodeTraverser::REMOVE_NODE` direct constant to make changes happen directly in the Rector rule - refactoring node adding from post-process to directly in the rule <br> #### New Features :partying_face: - \[Docblock] Move DocBlockUpdater service usage from AbstractRector to PhpDocTypeChanger ([#&#8203;4215](https://github.com/rectorphp/rector-src/pull/4215)) - Improve string support in Doctrine Annotations ([#&#8203;3645](https://github.com/rectorphp/rector-src/pull/3645)), Thanks [@&#8203;yguedidi](https://github.com/yguedidi)! - \[Php80] Fix add default nullable type on ClassPropertyAssignToConstructorPromotionRector ([#&#8203;4091](https://github.com/rectorphp/rector-src/pull/4091)) - Add STRICT\_BOOLEANS set ([#&#8203;4116](https://github.com/rectorphp/rector-src/pull/4116)) <br> #### Changes - \[FileProcessor] Add warning instead of skip InlineHTML on PhpFileProcessor ([#&#8203;4058](https://github.com/rectorphp/rector-src/pull/4058)) - Remove node adding collector ([#&#8203;4095](https://github.com/rectorphp/rector-src/pull/4095)) - Remove propperty to add collector, add them directly or as a constructor dependency ([#&#8203;4131](https://github.com/rectorphp/rector-src/pull/4131)) - Move ReturnArrayClassMethodToYieldRector to PHPUnit Rector ([#&#8203;4213](https://github.com/rectorphp/rector-src/pull/4213)) <br> #### Bugfixes :bug: - \[CodeQuality] Exclude first class callable from IntvalToTypeCastRector ([#&#8203;7962](https://github.com/rectorphp/rector/issues/7962)) ([#&#8203;4040](https://github.com/rectorphp/rector-src/pull/4040)), Thanks [@&#8203;thbley](https://github.com/thbley)! - \[CodingStyle] Skip first class callable on UnSpreadOperatorRector ([#&#8203;4041](https://github.com/rectorphp/rector-src/pull/4041)) - Skip StrvalToType for strval first class callable syntax ([#&#8203;4046](https://github.com/rectorphp/rector-src/pull/4046)), Thanks [@&#8203;NicoImparfait](https://github.com/NicoImparfait)! - Ensure check isFirstClassCallable() before node->getArgs() on CallLike ([#&#8203;4049](https://github.com/rectorphp/rector-src/pull/4049)) - \[CodeQuality] Skip multiple assigns append before foreach on ForeachItemsAssignToEmptyArrayToAssignRector ([#&#8203;4052](https://github.com/rectorphp/rector-src/pull/4052)) - \[CodeQuality] Skip deep append in if foreach before on ForeachItemsAssignToEmptyArrayToAssignRector ([#&#8203;4053](https://github.com/rectorphp/rector-src/pull/4053)) - \[NodeTypeResolver] Handle crash after next exit() on no namespaced code after removal next attribute ([#&#8203;4074](https://github.com/rectorphp/rector-src/pull/4074)) - \[FileProcessor] Show warning on has InlineHTML node if file has changed on PhpFileProcessor ([#&#8203;4079](https://github.com/rectorphp/rector-src/pull/4079)) - Make SimplifyRegexPatternRector work without parent nodes + deprecate BetterNodeFinder and findParent\* methods ([#&#8203;4105](https://github.com/rectorphp/rector-src/pull/4105)) - Fix StaticCallOnNonStaticToInstanceCallRector to skip parent's parent's method calls. ([#&#8203;4098](https://github.com/rectorphp/rector-src/pull/4098)), Thanks [@&#8203;klimslim](https://github.com/klimslim)! - \[CodingStyle] Skip countable object on CountArrayToEmptyArrayComparisonRector ([#&#8203;4108](https://github.com/rectorphp/rector-src/pull/4108)) - \[DeadCode] Skip used on Closure use next stmt on RemoveUnusedVariableAssignRector ([#&#8203;4042](https://github.com/rectorphp/rector-src/pull/4042)) - \[CodeQuality] Handle throw after if on ConsecutiveNullCompareReturnsToNullCoalesceQueueRector ([#&#8203;4107](https://github.com/rectorphp/rector-src/pull/4107)) - \[CodeQuality] Handle return new object and no return on ConsecutiveNullCompareReturnsToNullCoalesceQueueRector ([#&#8203;4112](https://github.com/rectorphp/rector-src/pull/4112)) - Make ConvertStaticPrivateConstantToSelfRector work for non-final classes, make part of code-quality set ([#&#8203;4114](https://github.com/rectorphp/rector-src/pull/4114)) - StringClassNameToClassConstantRector: cheap checks first ([#&#8203;4151](https://github.com/rectorphp/rector-src/pull/4151)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Reduce memory-consumption by simpler skip-patterns ([#&#8203;4152](https://github.com/rectorphp/rector-src/pull/4152)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Skipping: Use plain string functions instead of regex matching ([#&#8203;4153](https://github.com/rectorphp/rector-src/pull/4153)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Split instance of check to 2 rules ([#&#8203;4165](https://github.com/rectorphp/rector-src/pull/4165)) - Performance: Prevent sorting of files in PhpFilesFinder ([#&#8203;4164](https://github.com/rectorphp/rector-src/pull/4164)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Move PreferThisOrSelfMethodCallRector to PHPUnit rector package, to handle exact cases ([#&#8203;4194](https://github.com/rectorphp/rector-src/pull/4194)) - \[Renaming] Handle crash in trait use on RenameClassRector ([#&#8203;4196](https://github.com/rectorphp/rector-src/pull/4196)) - \[Php56] Handle infinite loop on big array method call on AddDefaultValueForUndefinedVariableRector ([#&#8203;4142](https://github.com/rectorphp/rector-src/pull/4142)) - \[Php56] Skip variable variable on AddDefaultValueForUndefinedVariableRector ([#&#8203;4148](https://github.com/rectorphp/rector-src/pull/4148)) <br> #### Removed :skull: - \[DeadCode] Remove removeNode() from RemoveDeadReturnRector, merge RemoveLastReturnRector to RemoveDeadReturnRector ([#&#8203;4085](https://github.com/rectorphp/rector-src/pull/4085)) - \[PHP+HTML cleanup] Remove MixPhpHtmlDecorator ([#&#8203;4054](https://github.com/rectorphp/rector-src/pull/4054)) - Remove HTML + PHP support, as must be handled in php-parser first ([#&#8203;4051](https://github.com/rectorphp/rector-src/pull/4051)) - Remove MultipleClassFileToPsr4ClassesRector as only PSR4 rule, bit risky and better handled with PHPStan + remove adding/removing files logic, use printer instead ([#&#8203;4117](https://github.com/rectorphp/rector-src/pull/4117)) - Remove NormalizeNamespaceByPSR4ComposerAutoloadRector as only moves files to namespaces, does not update any class referenes; better use IDE here ([#&#8203;4057](https://github.com/rectorphp/rector-src/pull/4057)) - Remove MultipleClassFileToPsr4ClassesRector as only PSR4 rule, bit risky and better handled with PHPStan + remove adding/removing files logic, use printer instead ([#&#8203;4117](https://github.com/rectorphp/rector-src/pull/4117)) - Remove AttributeCompatibleAnnotationRector, as only for one-time migration of private project, not suitable for general use ([#&#8203;4064](https://github.com/rectorphp/rector-src/pull/4064)) - Remove RemoveAlwaysTrueConditionSetInConstructor, as overly specific and not practical; better handle with PHPStan ([#&#8203;4065](https://github.com/rectorphp/rector-src/pull/4065)) - Remove deprecated UnionTypesRector and NarrowUnionTypeDocRector, use strict-based rules from TypeDeclaration set instead ([#&#8203;4069](https://github.com/rectorphp/rector-src/pull/4069)) - Remove TargetRemoveClassMethodRector, as IDE specific ([#&#8203;4076](https://github.com/rectorphp/rector-src/pull/4076)) - Remove ArrayKeysAndInArrayToArrayKeyExistsRector as narrow, does not check variable usage and might be on purpose ([#&#8203;4084](https://github.com/rectorphp/rector-src/pull/4084)) - Remove ChangeGlobalVariablesToPropertiesRector as the scope might change after the variable is defined, better handle with PHPStan ([#&#8203;4086](https://github.com/rectorphp/rector-src/pull/4086)) - Remove NewToConstructorInjectionRector as unused and only for demo purposes ([#&#8203;4087](https://github.com/rectorphp/rector-src/pull/4087)) - \[NodeTraverser] Remove double apply FileWithoutNamespace, remove recursive lookup stmts on BetterStandardPrinter ([#&#8203;4097](https://github.com/rectorphp/rector-src/pull/4097)) - Remove ActionInjectionToConstructorInjectionRector as rather for demo purposes, not practical ([#&#8203;4113](https://github.com/rectorphp/rector-src/pull/4113)) - Remove ConstantListClassToEnumRector as custom-made, not practical for enum upgrades ([#&#8203;4115](https://github.com/rectorphp/rector-src/pull/4115)) - Remove RemoveMethodCallParamRector, as unused ([#&#8203;4119](https://github.com/rectorphp/rector-src/pull/4119)) - Remove RemoveAllowDynamicPropertiesAttributeRector as attribute is a comment on lower PHP versions, also rather downgrade rule ([#&#8203;4120](https://github.com/rectorphp/rector-src/pull/4120)) - Remove DoctrineAnnotationClassToAttributeRector as made for custom project, not useful for general use ([#&#8203;4127](https://github.com/rectorphp/rector-src/pull/4127)) - Remove UnsetAndIssetToMethodCallRector as unused ([#&#8203;4123](https://github.com/rectorphp/rector-src/pull/4123)) - Remove MethodCallToMethodCallRector as unused ([#&#8203;4128](https://github.com/rectorphp/rector-src/pull/4128)) - Remove NewArgToMethodCallRector as unused ([#&#8203;4130](https://github.com/rectorphp/rector-src/pull/4130)) - Remove RemoveDelegatingParentCallRector as overly complex and usually on purpose ([#&#8203;4136](https://github.com/rectorphp/rector-src/pull/4136)) - Remove RemoveEmptyMethodCallRector as better handled by PHPStan ([#&#8203;4161](https://github.com/rectorphp/rector-src/pull/4161)) - Remove BetterNodeFinder::findLastInstanceOf() as unused + make resolvePreviousNode() private, as used only locally ([#&#8203;4195](https://github.com/rectorphp/rector-src/pull/4195)) - \[DeadCode] Remove Assign and AssignRef as node types on RemoveNonExistingVarAnnotationRector ([#&#8203;4209](https://github.com/rectorphp/rector-src/pull/4209)) ### [`v0.17.0`](https://github.com/rectorphp/rector/releases/tag/0.17.0): Released Rector 0.17 [Compare Source](https://github.com/rectorphp/rector/compare/0.16.0...0.17.0) #### Preparing for Rector 1.0 In this release, we focus on architecture improvements before reaching Rector 1.0. We want to lower the memory usage and make Rector run faster. **This include removing next/previous nodes** - this will most likely not affect you, as Rector rules were upgraded, but if you do you use them, switch to `StmtsAwareInterface` instead We follow PHPStan 1.6 move from April 2022, where you can **learn more**: <https://phpstan.org/blog/preprocessing-ast-for-custom-rules> - Replace NodeConnectingVisitor with ParentConnectingVisitor ([#&#8203;3900](https://github.com/rectorphp/rector-src/pull/3900)) To see how to refactor to `StmtsAwareInterface`, check these PRs: - Remove NEXT\_NODE dependency in ChangeAndIfToEarlyReturnRector, narrow to only closed scope function likes ([#&#8203;3913](https://github.com/rectorphp/rector-src/pull/3913)) - Remove NEXT\_NODE from SimplifyIfReturnBoolRector ([#&#8203;3915](https://github.com/rectorphp/rector-src/pull/3915)) - \[DeadCode] Remove next attribute on RemoveUnusedVariableAssignRector (\[[#&#8203;3917](https://github.com/rectorphp/rector/issues/3917)]\(<https://github.com/rectorphp/> - \[CodingStyle] Refactor CatchExceptionNameMatchingTypeRector to use StmtsAwareInterface ([#&#8203;3788](https://github.com/rectorphp/rector-src/pull/3788)) <br> #### Add/remove nodes directly 👍 The next improvement focuses on explicit node adding/removal. Thanks to `StmtsAwareInterface` we can add nodes directly. This makes Rector `refactor()` method contain all the code you need. - Cleanup usage of NodesToAddCollector, return nodes directly instead ([#&#8203;4003](https://github.com/rectorphp/rector-src/pull/4003)) - Cleanup removeNodeFromStatements(), removeArg(), removeParam(), removeStmt() methods and remove nodes directly ([#&#8203;4012](https://github.com/rectorphp/rector-src/pull/4012)) - Remove unused addNodeAfterNode(), return nodes instead ([#&#8203;4023](https://github.com/rectorphp/rector-src/pull/4023)) - Remove unused method addNodesBeforeNode() ([#&#8203;4024](https://github.com/rectorphp/rector-src/pull/4024)) <br> #### New Features :partying_face: - \[PHP 7.0] Add `IfIssetToCoalescingRector` ([#&#8203;3878](https://github.com/rectorphp/rector-src/pull/3878)) - Support attributes in `RemoveFinalFromEntityRector` ([#&#8203;3727](https://github.com/rectorphp/rector-src/pull/3727)), Thanks [@&#8203;alexndlm](https://github.com/alexndlm)! - Add `SwapMethodCallArgumentsRector` ([#&#8203;3726](https://github.com/rectorphp/rector-src/pull/3726)), Thanks [@&#8203;gaydamakha](https://github.com/gaydamakha)! - \[CodeQuality] Add `CleanupUnneededNullsafeOperatorRector` ([#&#8203;3767](https://github.com/rectorphp/rector-src/pull/3767)) - Make `ReturnNeverTypeRector` work with type declaration, add it to PHP 8.1 set ([#&#8203;3852](https://github.com/rectorphp/rector-src/pull/3852)) - \[TypeDeclaration] Add `BoolReturnTypeFromStrictScalarReturnsRector` ([#&#8203;3898](https://github.com/rectorphp/rector-src/pull/3898)) - Make ChangeGlobalVariablesToPropertiesRector add properties directly, remove Nette inject methods ([#&#8203;3957](https://github.com/rectorphp/rector-src/pull/3957)) - Utilize MinPhpVersionInterface in more rules ([#&#8203;3752](https://github.com/rectorphp/rector-src/pull/3752)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Dump dependency container and re-use it - 35% faster test-suite ([#&#8203;3809](https://github.com/rectorphp/rector-src/pull/3809)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Defer type-resolving in RemoveJustPropertyFetchRector ([#&#8203;3761](https://github.com/rectorphp/rector-src/pull/3761)), Thanks [@&#8203;staabm](https://github.com/staabm)! <br> #### Bugfixes :bug: - \[TypeDeclaration] Skip Arg unpack on AddMethodCallBasedStrictParamTypeRector ([#&#8203;3787](https://github.com/rectorphp/rector-src/pull/3787)) - \[CodeQuality] Add typed property support to `IssetOnPropertyObjectToPropertyExistsRector` ([#&#8203;3876](https://github.com/rectorphp/rector-src/pull/3876)) - \[CodeQuality] Skip non-array type on SimplifyForeachToArrayFilterRector ([#&#8203;3738](https://github.com/rectorphp/rector-src/pull/3738)) - Fix ShortenedObjectType not resolving to correct class reflection ([#&#8203;3397](https://github.com/rectorphp/rector-src/pull/3397)), Thanks [@&#8203;jackbentley](https://github.com/jackbentley)! - Extend code-quality set ([#&#8203;3773](https://github.com/rectorphp/rector-src/pull/3773)) - Don't neon-decode phpstan configs over and over again ([#&#8203;3796](https://github.com/rectorphp/rector-src/pull/3796)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[Console] Allow https url instead of git:// on SetupCICommand ([#&#8203;3799](https://github.com/rectorphp/rector-src/pull/3799)) - Fix integer range phpdoc types being treated as useless ([#&#8203;3825](https://github.com/rectorphp/rector-src/pull/3825)), Thanks [@&#8203;jlherren](https://github.com/jlherren)! - Fix nullable param in ClassPropertyAssignToConstructorPromotionRector ([#&#8203;3842](https://github.com/rectorphp/rector-src/pull/3842)) - Fix PrivatesAccessor: use selectFromArgs() instead ([#&#8203;3923](https://github.com/rectorphp/rector-src/pull/3923)), Thanks [@&#8203;staabm](https://github.com/staabm)! <br> #### Removed rules :skull: We've also remove bunch of rules, that were added in early days of Rector for demo purposes. They were not used as of any set for non-reliable cases. PHPStan and coding standards replace some of those. - \[CodeQuality] Remove ForToForeachRector, as overly deatiled and not reliable ([#&#8203;3747](https://github.com/rectorphp/rector-src/pull/3747)) - \[CodeQuality] Remove SimplifyIfExactValueReturnValueRector, as overly defensive + InlineSimplePropertyAnnotationRector as purely coding standard area ([#&#8203;3764](https://github.com/rectorphp/rector-src/pull/3764)) - \[CodingStyle] Remove RemoveDoubleUnderscoreInMethodNameRector, as naming is not handled for breaking reasons ([#&#8203;3765](https://github.com/rectorphp/rector-src/pull/3765)) - Remove RemoveUnusedVariableAssignRector, as could be breaking code in order of excution and hard to do reliable ([#&#8203;3793](https://github.com/rectorphp/rector-src/pull/3793)) - \[CodingStyle] Remove ConsistentPregDelimiterRector as not much practical, importance of regex is a testing it matches expectationg, area of static analysis ([#&#8203;3797](https://github.com/rectorphp/rector-src/pull/3797)) - Remove ToStringToMethodCallRector as not practical and only for demo, FalseReturnClassMethodToNullableRector, as requires detailed custom refactoring ([#&#8203;3854](https://github.com/rectorphp/rector-src/pull/3854)) - Remove ChangeOrIfReturnToEarlyReturnRector as makes code harder to read by duplication, rather use PHSPtan and extract method ([#&#8203;3916](https://github.com/rectorphp/rector-src/pull/3916)) - \[DeadCode] Remove RemoveDuplicatedIfReturnRector as can lead to unexpeced consequences, better use static analysis and contextual handling ([#&#8203;3926](https://github.com/rectorphp/rector-src/pull/3926)) - \[DeadCode] Remove RemoveDuplicatedInstanceOfRector as hardly practical ([#&#8203;3936](https://github.com/rectorphp/rector-src/pull/3936)) - \[CodeQuality] Remove ExplicitMethodCallOverMagicGetSetRector designed for nette smart object migration only, not useful for general projects ([#&#8203;3948](https://github.com/rectorphp/rector-src/pull/3948)) - Remove GetAndSetToMethodCallRector, as not practical and used for single legacy job ([#&#8203;3953](https://github.com/rectorphp/rector-src/pull/3953)) - Remove ChangeReadOnlyVariableWithDefaultValueToConstantRector overly complex and risky, better job for PHPStan ([#&#8203;3954](https://github.com/rectorphp/rector-src/pull/3954)) - Remove IsObjectOnIncompleteClassRector as blindly turns all incomplete checks to negated, better examine manually ([#&#8203;3969](https://github.com/rectorphp/rector-src/pull/3969)) - Remove ReservedObjectRector as requires explicit configuration and is handled by RenameClassRector already ([#&#8203;3975](https://github.com/rectorphp/rector-src/pull/3975)) - Remove ChangeReadOnlyPropertyWithDefaultValueToConstantRector as overly detailed checks, better use PHPStan and refactor individually ([#&#8203;4028](https://github.com/rectorphp/rector-src/pull/4028)) - Remove NewToMethodCallRector as unused core and no other extension, niche to use, better handle by PHPStorm ([#&#8203;4029](https://github.com/rectorphp/rector-src/pull/4029)) - \[CodingStyle] Remove AddFalseDefaultToBoolPropertyRector, as works with unrelaible docblocks ([#&#8203;3856](https://github.com/rectorphp/rector-src/pull/3856)) - Remove UpdateFileNameByClassNameFileSystemRector niche rule that was added just for example sake ([#&#8203;3849](https://github.com/rectorphp/rector-src/pull/3849)) - \[Transform] Remove ArgumentFuncCallToMethodCallRector as never used ([#&#8203;3774](https://github.com/rectorphp/rector-src/pull/3774)) - \[Transform] Remove DimFetchAssignToMethodCallRector as unused ([#&#8203;3775](https://github.com/rectorphp/rector-src/pull/3775)) - \[Transform] Remove FileGetContentsAndJsonDecodeToStaticCallRector as only for demo purposes ([#&#8203;3776](https://github.com/rectorphp/rector-src/pull/3776)) - \[Transform] Remove MethodCallToAnotherMethodCallWithArgumentsRector as unused ([#&#8203;3777](https://github.com/rectorphp/rector-src/pull/3777)) - \[CodeQuality] Remove SimplifyUselessLastVariableAssignRector as overly complex and should be handled individually ([#&#8203;3784](https://github.com/rectorphp/rector-src/pull/3784)) - Remove AddPregQuoteDelimiterRector as very narrow area and has not context awareness, better handle manually ([#&#8203;3927](https://github.com/rectorphp/rector-src/pull/3927)) - Remove TokenGetAllToObjectRector, as rare to use and leaky to handle, better handle in controller manual way ([#&#8203;4001](https://github.com/rectorphp/rector-src/pull/4001)) - Remove ChangeReflectionTypeToStringToGetNameRector as niche and overly detailed, better refactor reflectio na as a whole ([#&#8203;3976](https://github.com/rectorphp/rector-src/pull/3976)) - Remove RenameNamespaceRector, better handle by IDE or explicit RenameClassRector ([#&#8203;3979](https://github.com/rectorphp/rector-src/pull/3979)) - \[CodeQuality] Deprecate NarrowUnionTypeDocRector as focused on docblocks, and moving to type declarations ([#&#8203;3848](https://github.com/rectorphp/rector-src/pull/3848)) - Remove MakeTypedPropertyNullableIfCheckedRector as old fix of TypedPropertyRector rule, removed months ago ([#&#8203;3851](https://github.com/rectorphp/rector-src/pull/3851)) - \[PHP 8.0] Deprecate old UnionTypesRector that is dangerously moving docblocks, use type declaration rules instead ([#&#8203;3846](https://github.com/rectorphp/rector-src/pull/3846)) - \[CodingStyle] Remove OrderAttributesRector, as rather coding standard and does not have specific PSR example ([#&#8203;3838](https://github.com/rectorphp/rector-src/pull/3838)) - Remove unused PregMatchTypeCorrector, the 3rd param in preg\_match\_\* is now handled natively by PHPStan ([#&#8203;3824](https://github.com/rectorphp/rector-src/pull/3824)) - \[Restoration] Remove RemoveFinalFromEntityRector as used only to revert very old Rector bug ([#&#8203;3847](https://github.com/rectorphp/rector-src/pull/3847)) ### [`v0.16.0`](https://github.com/rectorphp/rector/releases/tag/0.16.0): Released Rector 0.16.0 [Compare Source](https://github.com/rectorphp/rector/compare/0.15.25...0.16.0) #### New Features :partying\_face: - \[TypeDeclaration] Add WhileNullableToInstanceofRector ([#&#8203;3680](https://github.com/rectorphp/rector-src/pull/3680)) <br> #### Bugfixes :bug: - Fix SingleInArrayToCompareRector if array item is variadic ([#&#8203;3640](https://github.com/rectorphp/rector-src/pull/3640)), Thanks [@&#8203;raoz](https://github.com/raoz)! - \[Php80] Handle crash leaveNode() returned invalid value of type integer on TokenGetAllToObjectRector ([#&#8203;3644](https://github.com/rectorphp/rector-src/pull/3644)) - \[TypeDeclaration] Handle mix InlineHTML on FileWithoutNamespace ([#&#8203;3648](https://github.com/rectorphp/rector-src/pull/3648)) - Simplify PhpFilesFinder ([#&#8203;3649](https://github.com/rectorphp/rector-src/pull/3649)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[Test] Rename fixture and refactor to solve random error ([#&#8203;3677](https://github.com/rectorphp/rector-src/pull/3677)) - \[TypeDeclaration] Refactor UnionTypeMapper::narrowBoolType() to allow bool|int|false converted to bool|int ([#&#8203;3685](https://github.com/rectorphp/rector-src/pull/3685)) - Update phpdoc-parser to ^1.20.3 ([#&#8203;3691](https://github.com/rectorphp/rector-src/pull/3691)) - \[Privatization] Skip variable assign append on ChangeReadOnlyVariableWithDefaultValueToConstantRector ([#&#8203;3687](https://github.com/rectorphp/rector-src/pull/3687)), Thanks [@&#8203;mickeytodd](https://github.com/mickeytodd)! - \[NodeManipulator] clean up multiple instanceof check on AssignManipulator ([#&#8203;3695](https://github.com/rectorphp/rector-src/pull/3695)) - \[CodeQuality] Using local variable $hasChanged on NarrowUnionTypeDocRector ([#&#8203;3697](https://github.com/rectorphp/rector-src/pull/3697)) - Cache on successful file processing ([#&#8203;3614](https://github.com/rectorphp/rector-src/pull/3614)), Thanks [@&#8203;yguedidi](https://github.com/yguedidi)! - \[CodingStyle] Skip concat on first arg on ConsistentImplodeRector ([#&#8203;3702](https://github.com/rectorphp/rector-src/pull/3702)), Thanks [@&#8203;nerones](https://github.com/nerones)! - Fix ExplicitMethodCallOverMagicGetSetRector with a protected method ([#&#8203;3732](https://github.com/rectorphp/rector-src/pull/3732)), Thanks [@&#8203;pierredup](https://github.com/pierredup)! - \[TypeDeclaration] Handle infinite loop on array\_reverse with index on AddMethodCallBasedStrictParamTypeRector on php8+ feature ([#&#8203;3678](https://github.com/rectorphp/rector-src/pull/3678)) - \[TypeDeclaration] Handle regression multiple params no longer working on AddMethodCallBasedStrictParamTypeRector ([#&#8203;3681](https://github.com/rectorphp/rector-src/pull/3681)) - \[TypeDeclaration] Add do { } while support on WhileNullableToInstanceofRector ([#&#8203;3682](https://github.com/rectorphp/rector-src/pull/3682)) - \[Php56]\[Php70]\[Php74] Handle infinite loop on AddDefaultValueForUndefinedVariableRector+IfToSpaceshipRector+ClosureToArrowFunctionRector ([#&#8203;3701](https://github.com/rectorphp/rector-src/pull/3701)) <br> #### Performance Improvements :rocket: - \[Performance] Using findFirst() for cast to (bool) so no need search all found nodes ([#&#8203;3642](https://github.com/rectorphp/rector-src/pull/3642)) - \[Performance] Using cheap chekc first on UndefinedVariableResolver::shouldSkipVariable() ([#&#8203;3643](https://github.com/rectorphp/rector-src/pull/3643)) - \[CodeQuality] Improve SimplifyIfElseToTernaryRector performance ([#&#8203;3721](https://github.com/rectorphp/rector-src/pull/3721)) - \[Renaming] Prevent overly greed type resolving in RenamePropertyRector ([#&#8203;3700](https://github.com/rectorphp/rector-src/pull/3700)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Don't calculate diffs when `--no-diffs` is given ([#&#8203;3710](https://github.com/rectorphp/rector-src/pull/3710)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Calculate diff only once per file after refactoring ([#&#8203;3711](https://github.com/rectorphp/rector-src/pull/3711)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Improve PropertyFetchAnalyzer performance ([#&#8203;3654](https://github.com/rectorphp/rector-src/pull/3654)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Improve LocalMethodCallFinder performance ([#&#8203;3651](https://github.com/rectorphp/rector-src/pull/3651)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Improve LocalConstantFinder performance ([#&#8203;3652](https://github.com/rectorphp/rector-src/pull/3652)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Improve NodeComparator performance ([#&#8203;3659](https://github.com/rectorphp/rector-src/pull/3659)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Improve ReflectionResolver performance ([#&#8203;3658](https://github.com/rectorphp/rector-src/pull/3658)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Improve ParentClassMethodTypeOverrideGuard performance ([#&#8203;3660](https://github.com/rectorphp/rector-src/pull/3660)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[PHPStanStaticTypeMapper] Improve UnionTypeMapper performance ([#&#8203;3686](https://github.com/rectorphp/rector-src/pull/3686)) - \[PHPStanStaticTypeMapper] Improve UnionTypeMapper performance take 2 ([rectorphp/rector-src@`931e6e2`](https://github.com/rectorphp/rector-src/commit/931e6e24502a70dd19cd93c0ef10510b23213f87)) - \[PHPStanStaticTypeMapper] Improve performance of UnionTypeMapper take 3 ([#&#8203;3690](https://github.com/rectorphp/rector-src/pull/3690)) - \[Renaming] Improve performance of RenameFunctionRector ([#&#8203;3699](https://github.com/rectorphp/rector-src/pull/3699)) - Add e2e tests for consecutive changing runs ([#&#8203;3666](https://github.com/rectorphp/rector-src/pull/3666)), Thanks [@&#8203;yguedidi](https://github.com/yguedidi)! - \[Renaming] Improve performance of RenamePropertyRector ([#&#8203;3698](https://github.com/rectorphp/rector-src/pull/3698)) - \[Naming] Improve performance by using findFirst() for casted to (bool) on BreakingVariableRenameGuard ([#&#8203;3703](https://github.com/rectorphp/rector-src/pull/3703)) - \[PostRector] Improve performance NameImportingPostRector ([#&#8203;3708](https://github.com/rectorphp/rector-src/pull/3708)) - \[Ast] Improve AstResolver and ClassLikeAstResolver performance ([#&#8203;3714](https://github.com/rectorphp/rector-src/pull/3714)) - \[NodeManipulator] Improve IfManipulator::collectNestedIfsWithNonBreaking() performance ([#&#8203;3720](https://github.com/rectorphp/rector-src/pull/3720)) - Prevent unnecessary IO in ChangedFilesDetector ([#&#8203;3650](https://github.com/rectorphp/rector-src/pull/3650)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[BetterPhpDocParser] Simplify BetterTokenIterator ([#&#8203;3656](https://github.com/rectorphp/rector-src/pull/3656)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[Skipper] Prevent unnecessary IO ([#&#8203;3664](https://github.com/rectorphp/rector-src/pull/3664)), Thanks [@&#8203;staabm](https://github.com/staabm)! - NodeTypeResolver: prevent unncessary reflection calls ([#&#8203;3647](https://github.com/rectorphp/rector-src/pull/3647)), Thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v0.15.25`](https://github.com/rectorphp/rector/compare/0.15.24...0.15.25) [Compare Source](https://github.com/rectorphp/rector/compare/0.15.24...0.15.25) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 3am every weekday,every weekend" in timezone Europe/Amsterdam, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi45OS4wIiwidXBkYXRlZEluVmVyIjoiNDIuOTkuMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciIsImxhYmVscyI6W119-->
chore(deps): update dependency rector/rector to ^0.19.0
Some checks failed
renovate/artifacts Artifact file update failure
renovate/stability-days Updates have met minimum release age requirement
73ad7f2093
Author
Collaborator

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: composer.lock
Command failed: composer update rector/rector:0.19.8 --with-dependencies --ignore-platform-req=ext-* --ignore-platform-req=lib-* --no-ansi --no-interaction --no-scripts --no-autoloader --no-plugins --minimal-changes
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - symfony/proxy-manager-bridge is locked to version v6.2.7 and an update of this package was not requested.
    - friendsofphp/proxy-manager-lts v1.0.14 requires laminas/laminas-code ~3.4.1|^4.0 -> satisfiable by laminas/laminas-code[4.10.0].
    - laminas/laminas-code 4.10.0 requires php ~8.1.0 || ~8.2.0 -> your php version (8.5.5) does not satisfy that requirement.
    - symfony/proxy-manager-bridge v6.2.7 requires friendsofphp/proxy-manager-lts ^1.0.2 -> satisfiable by friendsofphp/proxy-manager-lts[v1.0.14].


### ⚠️ Artifact update problem Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is. ♻ Renovate will retry this branch, including artifacts, only when one of the following happens: - any of the package files in this branch needs updating, or - the branch becomes conflicted, or - you click the rebase/retry checkbox if found above, or - you rename this PR's title to start with "rebase!" to trigger it manually The artifact failure details are included below: ##### File name: composer.lock ``` Command failed: composer update rector/rector:0.19.8 --with-dependencies --ignore-platform-req=ext-* --ignore-platform-req=lib-* --no-ansi --no-interaction --no-scripts --no-autoloader --no-plugins --minimal-changes Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages. Problem 1 - symfony/proxy-manager-bridge is locked to version v6.2.7 and an update of this package was not requested. - friendsofphp/proxy-manager-lts v1.0.14 requires laminas/laminas-code ~3.4.1|^4.0 -> satisfiable by laminas/laminas-code[4.10.0]. - laminas/laminas-code 4.10.0 requires php ~8.1.0 || ~8.2.0 -> your php version (8.5.5) does not satisfy that requirement. - symfony/proxy-manager-bridge v6.2.7 requires friendsofphp/proxy-manager-lts ^1.0.2 -> satisfiable by friendsofphp/proxy-manager-lts[v1.0.14]. ```
renovate-bot force-pushed renovate/rector-rector-0.x from 73ad7f2093
Some checks failed
renovate/artifacts Artifact file update failure
renovate/stability-days Updates have met minimum release age requirement
to 05305accba
Some checks failed
renovate/artifacts Artifact file update failure
renovate/stability-days Updates have met minimum release age requirement
2026-05-03 19:38:26 +00:00
Compare
Some checks failed
renovate/artifacts Artifact file update failure
renovate/stability-days Updates have met minimum release age requirement
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin renovate/rector-rector-0.x:renovate/rector-rector-0.x
git switch renovate/rector-rector-0.x

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch master
git merge --no-ff renovate/rector-rector-0.x
git switch renovate/rector-rector-0.x
git rebase master
git switch master
git merge --ff-only renovate/rector-rector-0.x
git switch renovate/rector-rector-0.x
git rebase master
git switch master
git merge --no-ff renovate/rector-rector-0.x
git switch master
git merge --squash renovate/rector-rector-0.x
git switch master
git merge --ff-only renovate/rector-rector-0.x
git switch master
git merge renovate/rector-rector-0.x
git push origin master
Sign in to join this conversation.
No description provided.