Repository navigation
Update dependency rector/rector to v2.8.4 - #2634
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
Coverage Report
Tags
Impacted Files
Last update to 34cb334 at 12:06pm UTC |
renovate
Bot
force-pushed
the
renovate/services/rector-rector-2.x-lockfile
branch
from
August 6, 2026 23:42
973ca51 to
23c561b
Compare
renovate
Bot
force-pushed
the
renovate/services/rector-rector-2.x-lockfile
branch
from
August 15, 2026 11:55
23c561b to
37dc524
Compare
renovate
Bot
force-pushed
the
renovate/services/rector-rector-2.x-lockfile
branch
from
August 24, 2026 17:37
37dc524 to
b5cbd7e
Compare
renovate
Bot
force-pushed
the
renovate/services/rector-rector-2.x-lockfile
branch
2 times, most recently
from
August 30, 2026 07:53
0ba5d78 to
9673cb1
Compare
renovate
Bot
force-pushed
the
renovate/services/rector-rector-2.x-lockfile
branch
from
August 30, 2026 22:16
9673cb1 to
a7a9ac7
Compare
renovate
Bot
force-pushed
the
renovate/services/rector-rector-2.x-lockfile
branch
from
September 2, 2026 11:40
a7a9ac7 to
6abe8f7
Compare
renovate
Bot
force-pushed
the
renovate/services/rector-rector-2.x-lockfile
branch
from
September 7, 2026 17:31
6abe8f7 to
2ff0497
Compare
renovate
Bot
force-pushed
the
renovate/services/rector-rector-2.x-lockfile
branch
from
October 10, 2026 15:03
2ff0497 to
78ca5c6
Compare
renovate
Bot
force-pushed
the
renovate/services/rector-rector-2.x-lockfile
branch
from
October 21, 2026 19:23
78ca5c6 to
d778c43
Compare
renovate
Bot
force-pushed
the
renovate/services/rector-rector-2.x-lockfile
branch
from
October 30, 2026 03:37
d778c43 to
14f6e87
Compare
renovate
Bot
force-pushed
the
renovate/services/rector-rector-2.x-lockfile
branch
from
November 7, 2026 12:05
14f6e87 to
34cb334
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR body was truncated due to platform limits.
This PR contains the following updates:
2.4.4→2.8.4Release Notes
rectorphp/rector (rector/rector)
v2.8.4: Released Rector 2.8.4Compare Source
PHP 8.6 set additions and faster runs 🚀
This release grows the PHP 8.6 set with deprecated function alias renames, moves
ConsistentImplodeRectordown to the php74 set, and ships another round of performance work across the runner, printer, and reflection refresh.New Features ⭐
define()in php86 set (#8906)ConsistentImplodeRectorfrom php80 to php74 (#8894) Thanks @zoliszaboBugfixes 🐛
AnnotationToAttributeRector: fold unknown named args into the attribute's$options(#8914) Thanks @kixMbStrrposEncodingArgumentPositionRectortreating mixed$offsetas encoding (#8913)RemoveDefaultValueFromAssignedPropertyRector(#8915)RemoveAlwaysTrueIfConditionRector(#8896)Performance Improvements 🚀
AstResolver(#8903)File::containsHTML()onAddUseStatementGuardto cut a double traverse (#8899)RectorRunner::run()(#8891)wrapBinaryOpWithBrackets()forCallLikenodes inBetterStandardPrinter::p()(#8890)Internals ⚙️
StaticDoctrineAnnotationParser(#8881) Thanks @ondrejmirtesType::toNativePhpTypeNode()andType::toPhpDocNode()instead of own type mappers (#8885) Thanks @ondrejmirtesInClassNodeonPHPStanNodeScopeResolver(#8902)origNodeattribute get onRectorRunner(#8893)BetterStandardPrinter::pExpr_Ternary()method (#8887)@propertyfor$insertionMaponBetterStandardPrinter(#8888)v2.8.3: Released Rector 2.8.3Compare Source
Faster node traversal and updated PHPStan stack 🚀
This release brings performance improvements to node visitors, reducing unnecessary traversals and reflection resolution during analysis.
It also updates PHPStan to 2.3.4 and
phpstan/phpdoc-parserto 2.4, with compatibility fixes for the updated PHPDoc type nodes.Performance Improvements 🚀
ByRefNodeVisitorby tracking by-reference variable names perFunctionLike(#8879) Thanks @samsonasikCallLikeReflectionNodeVisitor(#8880) Thanks @samsonasikBugfixes 🐛
AddArrayFunctionClosureParamTypeRector: resolve array item types from unions of arrays (#8877) Thanks @SanderMullerTMPDIRvalues (#8878) Thanks @SanderMullerInternals ⚙️
phpstan/phpdoc-parserto 2.4, adapting PHPDoc node handling for the newNameNode,FullyQualifiedNameNode, andRelativeNameNodetypes (#8883) Thanks @ondrejmirtesv2.8.2: Released Rector 2.8.2Compare Source
Leaner PHPDoc stack and a fluent composer-based config 🚀
This release leans on
phpstan/phpdoc-parserdirectly: Rector drops its own forked parser, printer, token iterator and type-node subclasses, and reuses the upstream parser, format-preserving printer, node traverser and type nodes. Fewer moving parts, one source of truth for PHPDoc handling, and it rides the PHPStan 2.3.3 bump. Thanks @ondrejmirtes.On the config side,
withComposerBased()now auto-detects installed packages when called with no argument, and a fluentwithComposerBasedRule()builder lands across core and therector-*sets.New features 🥳
withComposerBasedRule()to the fluentRectorConfig::configure()builder (#8875)withComposerBased()called with no argument (#8748) Thanks @MadBox-99Performance Improvements 🚀
RectorRegistry::forNodeAndFile()(#8860) Thanks @samsonasikarray_values()when arrays are already lists or called too early (#8857) Thanks @samsonasikBugfixes 🐛
TernaryToNullsafeCoalesceRector: fix a redundant nullsafe property access under coalesce (#8864)BinaryOpBetweenNumberAndStringRector: skip an array dim fetch (#8862)ArrayCallbackParamTypeResolver(#8874) Thanks @SanderMullerwithRootFiles()to keep the cache hash stable (#8870) Thanks @M-arcuspreload-split-package.phpto fix a PHPStan Turbo notice onrector-*packages (#8865) Thanks @samsonasikInternals ⚙️
phpstan/phpdoc-parserstack directly: parser without subclass, format-preserving printer,NodeTraverser, and move union dedup/array printing into type mappers (#8871, #8863, #8855, #8858) Thanks @ondrejmirtesBetterTokenIterator, theBracketsAwareIntersectionTypeNode, and type-node subclasses that only changed__toString()(#8856, #8876, #8872) Thanks @ondrejmirtesrector-doctrine 🟠
withComposerBasedRule()in the composer-based set (#542)rector-symfony 🎵
EventSubscriberInterfacetoAsEventListenerattributes (#1094)RequestQueryToMapQueryParameterRector(#1089) Thanks @RajekevinContainerGetNameToTypeInTestsRector: skip when the FQCN service is not the named service (#1093) Thanks @jdreesenwithSkip(#1096)PhpVersionconstants directly instead of the deprecatedPhpVersionFeature(#1095)Class_namespace forChangeMethodVisibilityRector(#1092)withComposerBasedRule()in the composer-based sets (#1098)rector-phpunit 🟢
IntersectionTypeNodefromphpstan/phpdoc-parserand update fixtures for the new printer (#815, #814) Thanks @ondrejmirteswithComposerBasedRule()in the composer-based set (#816)rector-downgrade-php ⬇️
phpstan/phpdoc-parserprinter, printing intersections without redundant brackets (#420) Thanks @ondrejmirtesv2.8.1: Released Rector 2.8.1Compare Source
Fixes
v2.8.0: Released Rector 2.8Compare Source
Faster runs, single-pass rules, and a leaner rule set 🚀
The Rector core engine is ~26 % faster (1.36x) with ~8 % less memory than 2.7.0.
If you run PHP 8.3+, it's 3x faster using PHPStan Turbo, the native parsing extension shipped with
phpstan/phpstan:Turbo factor measured on this release via an A/B run on Rector's own
rules/(24-core host, PHP 8.4, cold, identical changed-file fingerprint): ~2.4x wall and ~2.6x worker CPU. Turbo speeds up PHPStan parsing in the workers, so the wall-time gain scales with the available core count.This release is mostly about speed and reliability. A large performance campaign hoists cheap node guards in front of expensive reflection, scope and type lookups across hundreds of rules, replaces per-node config scans in configurable rules with keyed lookups, and resolves short names and unused imports in a single AST walk.
Rules now converge in a single pass: instead of a re-processing guard, the engine iterates rules to a fixed point and tests enforce idempotency, so a rule that changes a file produces the same result whether it runs once or many times.
We also trimmed the rule set: many niche, context-dependent rules that are not part of any set and rarely used are now deprecated. Deprecated rules still run and print a warning; they will be removed in a future major release. The goal is a smaller set of valuable, reliable rules for everyday upgrades.
New features 🥳
ExplicitNullableObjectInstanceRector, replacing 4 nullable-object instanceof rules (#8636)--alloption tolist-rulesto list every rule in core andrector-*packages (#8637)list-rulescommand (#8533)Performance Improvements 🚀
phpstan/phpstan, on PHP 8.3+ - no main-process restart, the workers do the analysis (#8812) Thanks @SanderMullerClass_/ClassLikenode and addgetClassReflection()toAbstractRector:RemoveParentDelegatingClassMethodRector,ReturnTypeFromMockObjectRector,AddVoidReturnTypeWhereNoReturnRectorandChangeMethodVisibilityRector(#8824, #8827, #8828, #8830, #8831)UseImportNameMatcher::resolveName()and resolve the parent class reflection by name inPhp4ConstructorRector(#8841, #8838)array_values()inBetterStandardPrinter::pArray()(#8814, #8821)ClassReflectionby class content hash to stop memory growth on class refresh (#8731, #8728, #8729)ClassNameImportContext(#8687)realpath()of skip patterns inFileInfoMatcher(#8699) Thanks @SanderMullerStaticPHPUnitEnvironment::isPHPUnitRunand replace theisStringNamewildcard loop with a singlestrpbrkscan (#8732, #8733)ContextNodeVisitorby tracking loop/try/attribute depth (#8741)NodeComparator::areNodesEqualbefore printing (#8752)enterNode()toFileProcessorso it runs once per file (#8593)ConvertStaticToSelfRector,ArrayToFirstClassCallableRectorandSimplifyEmptyCheckOnEmptyArrayRectorwith cheap guards before scope fetching (#8801, #8796, #8795) Thanks @alfredbezforeach(#8761)extends/implementsnames and drop the unused process property on the node scope (#8788, #8792)FileProcessornow that rules converge in a single pass (#8811)Bugfixes 🐛
NewlineBeforeNewAssignSetRector: fix a false positive on a local var and$thisproperty name collision (#8535)SimplifyQuoteEscapeRector: handle strings with accented characters (#8532)TernaryToNullsafeCoalesceRector: skip mixed and untyped calls (#8531) Thanks @roxblnfkTernaryToNullCoalescingRector: preserve fallback parentheses on theIdentical/NotIdenticalpath (#8674)AddArrowFunctionReturnTypeRector: fix a crash onNonexistentParentClassType(#8568)DowngradeEnumToConstantListClassRectorandRenameMethodRector(#8727)StrContainsRector/MbStrContainsRector: skip a non-zerostrpos()/mb_strpos()offset (#8640, #8642) Thanks @guillaume-sainthillierSplitGroupedClassConstantsRector: preserve the attribute and type (#8650)RemoveUselessUnionReturnDocblockRector: skip astatic/$thisunion@return(#8649)StrictArrayParamDimFetchRector: skip a private method param called with anArrayAccessarg (#8648)ReadOnlyAnonymousClassRector: skip an anonymous class with attributes (#8665)NullToStrictStringFuncCallArgRector: skip an arg already cast to the target type (#8688)AddNameToBooleanArgumentRector: skipsession_set_save_handler(#8750)RemoveDuplicatedCaseInSwitchRector: compare switch case statements node-by-node (#8754)MergePhpstanDocTagIntoNativeRector: keep the native@param/@var/@returndescription (#8781)nullis still reported, acrossrector-doctrine,rector-symfony,rector-phpunitandrector-downgrade-php(doctrine #539, symfony #1087, phpunit #810, downgrade #418)fix(parallel): report the error limit only when it is actually reached (#8844) Thanks @alfredbezChangedFilesDetectorPortableCacheTest(#8537)Deprecations 💀
Deprecated rules still run and print a warning; they will be removed in a future major release. These are niche, context-dependent or rarely used rules outside the main PHP upgrade path.
Transform / Arguments
FuncCallToNewRector(#8776),FuncCallToStaticCallRector(#8775),MethodCallToFuncCallRector(#8769),MethodCallToStaticCallRector(#8770),NewToStaticCallRector(#8768),StaticCallToMethodCallRector(#8759),ConstFetchToClassConstFetchRector(#8771),MergeInterfacesRector(#8772),ArrayDimFetchToMethodCallRector(#8762),StringToClassConstantRector(#8779),RemoveMethodCallParamRector(#8766)ReplaceArgumentDefaultValueRectorandFunctionArgumentDefaultValueReplacerRectorin favor of dedicated rules (#8686, #8692)Renaming
RenameAnnotationRector(#8780),RenameStaticMethodRector(#8777)Naming (and the
SetList::NAMINGset itself)RenameParamToMatchTypeRector(#8553),RenamePropertyToMatchTypeRector(#8547),RenameVariableToMatchNewTypeRector(#8554),RenameVariableToMatchMethodCallReturnTypeRector(#8549),RenameForeachValueVariableToMatchExprVariableRector(#8548),RenameForeachValueVariableToMatchMethodCallReturnTypeRector(#8550), and the naming prepared set warning (#8555)TypeDeclaration
ParamTypeByMethodCallTypeRectorand its Object/Scalar/Array splits (#8567),ParamTypeByParentCallTypeRector(#8813),AddPropertyTypeDeclarationRector(#8774),AddParamStringTypeFromSprintfUseRector(#8723),DeclareStrictTypesRectorin favor ofSafeDeclareStrictTypesRector(#8562),BinaryOpNullableToInstanceofRectorfolded intoExplicitNullableObjectInstanceRector(#8817)CodeQuality / CodingStyle / DeadCode / EarlyReturn / Php
CompleteDynamicPropertiesRector(#8753),SwitchTrueToMatchRector(#8622),InnerFunctionToPrivateMethodRector(#8621),MoveInnerFunctionToTopLevelRector(#8616),ForRepeatedCountToOwnVariableRector(#8620),CallUserFuncWithArrowFunctionToInlineRector(#8615),RemoveUselessIsObjectCheckRector(#8614),SimplifyStrposLowerRector(#8611),SetTypeToCastRector(#8610),ForeachItemsAssignToEmptyArrayToAssignRector(#8577),PostIncDecToPreIncDecRector(#8583),TernaryFalseExpressionToIfRector(#8683),RemoveDeadReturnRectorin favor ofRemoveAlwaysTrueIfConditionRector(#8685),RemoveDuplicatedReturnSelfDocblockRector(#8634),RemoveParentDelegatingConstructorRector(#8755),ChangeConstantVisibilityRector(#8767),AddOverrideAttributeToOverriddenMethodsRector(#8773),RemoveTraitUseRector(#8778),ReturnEarlyIfVariableRector(#8818)Internals ⚙️
tomasvotruba/unused-publicwithshipmonk/dead-code-detector(#8530)NodeVisitorand moveenterNode()out ofAbstractRectorintoRectorRunner(#8541, #8560)RectorRegistryand merge the skipper services into a singleSkipper(#8600, #8601, #8604)symplify/rule-doc-generator-contractsunder theRector\RuleDocnamespace (#8586)@apiannotations, unused collectors, converters and interfaces, thecreated_by_ruleattribute andRectifiedAnalyzer, and the deprecatedwithPhp53Sets()..withPhp74Sets()and cache-meta methods (#8794, #8803, #8804, #8805, #8806, #8807, #8808, #8809, #8810, #8798, #8799)MergePhpstanDocTagIntoNativeRectorin the type-declaration docblock level (#8763)VariableNamingtorector-downgrade-php(#8797, downgrade #417)PhpVersionFeatureand usePhpVersionconstants directly in rules (#8839)custom-ruleandsetup-cicommands, and the unuseddoctrine/inflectordependency (#8815, #8816)NoGetClassReflectionOnScopeRulePHPStan rule and route class reflection through a saferfetchClassLikeReflection(), used inReadonlyClassManipulatorandObjectTypeSpecifier(#8820, #8829, #8832, #8835, #8840)NullToStrictStringIntConverter, use an explicitnulltype in the null-to-strict rules (#8837)rector-doctrine 🟠
AddArrayResultColumnNamesRector(#533)RemoveNullFromNullableCollectionTypeRectorto a singleClass_node and make it idempotent (#535, #534)rector-symfony 🎵
Schedule::with()toadd()and Doctrine middleware renames (#1082)eraseCredentialsbody into an existing__serialize()instead of a deadserialize()(#1085)ReplaceArgumentDefaultValueRectorusages as dedicated rules (#1079)LogoutHandlerToLogoutEventSubscriberRectoridempotent (#1080)StringToArrayArgumentProcessRectorat upper version bounds (#1076, #1075)ServiceMapout of theServiceMapProviderconstructor (#1073)AccessType/Accessorannotation-to-attribute rules and drop the orphaned enum (#1086, #1088)rector-phpunit 🟢
ScenarioToTestAnnotationRectorto replace thescenarioannotation withtest(#809)IdentifierManipulator(#808)WillReturnCallbackFallbackToReturnFalseRector: skip never-returning fall-through and a trailing comment after return (#801, #800)AssertEmptyNullableObjectToAssertInstanceofRector: skip an anonymous class (#792)SuffixMockObjectPropertyRectoras it can produce invalid variable names (#795)AddProphecyTraitRectoridempotent and skip a non-test class early (#806, #793)AssertRegExpRectorand the PHPUnit test-case call guard with a cheap method-name gate (#796, #807)ScenarioToTestAnnotationRectorand drop the deprecatedfindFirstNonAnonymousClass()call (#812, #811)rector-downgrade-php ⬇️
DowngradeIteratorCountToArrayRector, and skipiterator_to_array()/iterator_count()already guarded byis_array()(#414, #415)array_key_first/array_key_lastin a single statement traversal, and convert nested arrow functions to anonymous functions in a single pass (#416, #413)JsonConstCleaner(#410)DowngradeParameterTypeWideningRector(#411)VariableNamingservice moved from core, and fix the missingCOVARIANT_RETURNconstant withPhpVersion::PHP_74(#417, #419)v2.7.0: Released Rector 2.7Compare Source
New Rules ✨
TernaryToNullsafeCoalesceRector(#8499)BoolReturnTypeFromBooleanConstAndStrictReturnsRectorfor mixed const + strict bool returns (#8498)ConstructorReadonlyAssignToDefaultRectorfor readonly property defaults (#8502)RemoveOverriddenAssignBeforeIfElseRector(#8505)Performance Improvements 🚀
ShortNameResolver, so name import no longer rescans the whole file for every name - up to ~24 % fewer CPU instructions on large projects (#8524)FileDiffhas no content change (#8523)FileSystem::writeAtomic()inFileCacheStorageto avoid partial cache reads on parallel runs (#8520)Bugfixes 🐛
RenamePropertyRector: rename the property both in the trait and in the class property itself (#8518)RenameClassRector: throw on same old and new class in the configuration (#8515)ScalarParamTypeByMethodCallTypeRector: skip string param inference to avoid unsafe scalar coercion (#8514)RepeatedAndNotEqualToNotInArrayRector/RepeatedOrEqualToInArrayRector: skip short-circuit dependent values (#8516)SeparateMultiUseImportsRector: keep traituseadaptations (#8510)Privatize*Rector: drop thefinalflag when changingprotectedtoprivate, sinceprivate finalis forbidden on PHP 8.4 (#8509)AddNameToBooleanArgumentRector/AddNameToNullArgumentRector: skip callees marked@no-named-arguments(#8508)Configuration
📅 Schedule: (UTC)
🚦 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.
This PR was generated by Mend Renovate. View the repository job log.