Repository navigation
chore(deps): update dependency rector/rector to v2.9.3 - #84
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
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
php-imgproxy | 7f29427 | Nov 26 2026, 01:07 AM |
Contributor
Author
|
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.
This PR contains the following updates:
2.8.5→2.9.3Release Notes
rectorphp/rector (rector/rector)
v2.9.3: Released Rector 2.9.3Compare Source
Safer rules and smarter caching 🛡️
This release continues our effort towards safer and more reliable automated refactoring. More than 30 rules and internal analyzers now rely on native types where PHPDoc types alone cannot guarantee that a change preserves runtime behavior.
Caching also gets smarter: changes to parent classes, interfaces and traits now invalidate cached files that depend on them.
On top of that, we introduce a new
dump-configcommand, Pest support, and switch to a new console framework.New Features 🥳
dump-configcommand to print the resolved Rector configuration as JSON (#9071)[DX] Support
--configindump-config,list-rulesandvalidate-configcommands (#9103)[Php55] Extend
StringClassNameToClassConstantRectorto handle class method references, concatenated class method prefixes and references to the current class (#9066, #9068, #9069, #9070)[Renaming] Support case-insensitive class and constant name matching in
RenameClassRectorandRenameConstantRector(#9111, #9112)[Set] Add Pest support to composer-based sets (#9119, #9120)
Smarter Caching ⚡
--clear-cache, so cache entries created during rule initialization are preserved (#9085)Native types over PHPDoc assumptions 🛡️
PHPDoc types are valuable for static analysis, but they do not necessarily reflect the actual runtime types.
More than 30 rules and internal analyzers have been hardened to use native types where relying on PHPDoc types could introduce unexpected behavior.
This affects rules across CodeQuality, CodingStyle, DeadCode, TypeDeclaration and PHP upgrade sets.
Among others:
UnnecessaryTernaryExpressionRector(#9134)instanceofassertions based solely on PHPDoc types inRemoveDeadInstanceOfAssertRector(#9124)RemoveAlwaysTrueIfConditionRectorwhen their types are only guaranteed by PHPDoc (#9125)RemoveDeadLoopRector(#9139)AddArrowFunctionReturnTypeRector(#9167)The goal stays the same: prefer keeping code unchanged over making a potentially unsafe change.
Bugfixes 🐛
Core
BetterStandardPrinter(#9102)CodeQuality
InlineIfToExplicitIfRector(#9078)SimplifyTautologyTernaryRector(#9084)||when converting negated multi-argumentisset()inIssetOnPropertyObjectToPropertyExistsRector(#9098)DeadCode
RecastingRemovalRector(#9094)CodingStyle and TypeDeclaration
FunctionFirstClassCallableRector(#9067)NewlineBeforeNewAssignSetRector(#9118)AddArrowFunctionParamArrayWhereDimFetchRector(#9073, #9074)PHP sets
ArrayFirstLastRector(#9079, #9080, #9081)get_parent_class()in classes without a parent inRemoveGetClassGetParentClassNoArgsRector(#9101)MyCLabsMethodCallToEnumConstRector(#9086, #9088)ChangeSwitchToMatchRector(#9065)ClosureToArrowFunctionRector(#9097)BinaryOpBetweenNumberAndStringRectorto arithmetic and bitwise operators (#9114)PregReplaceEModifierRector(#9100)create_function()scope inCreateFunctionToAnonymousFunctionRector(#9099)Developer Experience ✨
withSets()(#9089)treatClassesAsFinal()andwithSymfonyContainerXml()configuration indump-configoutput (#9109, #9115)Removed 💀
--rules-summaryoption (#9095)SetList::PHP_POLYFILLSconstant (#9064)Internals ⚙️
symfony/consolewith theentropy/entropyconsole framework (#8787)CallLike::getArg()for named and positional argument resolution across rules (#9075)ConfigDumperTestto prevent test isolation issues (#9077)Full Changelog: rectorphp/rector@2.9.2...2.9.3
v2.9.2: Released Rector 2.9.2Compare Source
Bugfixes 🐛
[CodeQuality] Remove
NarrowPreviousExceptionCodeArgRector, as it changesgetCode()of new exception to0(#9062), reported in #9061PHP does not inherit the code from the previous exception, so
new X('msg', previous: $e)returns0fromgetCode(), not$e->getCode(). The rule was part of thenamed-argsset and code quality level in 2.9.0. If you registered it manually, remove it from your config.[CodeQuality] Restore adding code with named
previous:argument inThrowWithPreviousExceptionRector(#9063)v2.9.1Compare Source
v2.9.0: Released Rector 2.9.0Compare Source
Leaner rule set and safer rules 🧹
This release removes ~100 rules deprecated in past releases. They already threw on use, were part of no set and were rarely used. If your
rector.phpstill registers one of them, remove it from the config. The goal stays the same: a smaller set of valuable, reliable rules for everyday upgrades.The rest of the release is about safer changes - more than 30 rules now skip or keep code where the change could alter behavior: side effects, evaluation order, loose comparisons, fall-through cases, nullable types and more.
New Features 🥳
NarrowPreviousExceptionCodeArgRector, part of code-quality and named-args sets (#9052)try { $someCode = 1; } catch (Throwable $throwable) { - throw new \RuntimeException('ups', $throwable->getCode(), $throwable); + throw new \RuntimeException('ups', previous: $throwable); }NewMethodCallWithoutParenthesesRector(#9009, #9010) Thanks @alexndlmlist()destruct inListToArrayDestructRector(#9028)voidon final methods of non-final classes inAddVoidReturnTypeWhereNoReturnRector(#9051)abstract class SomeClass { - final protected function run() + final protected function run(): void { echo 1; } }objectreturn type for(object)cast inReturnTypeFromReturnCastRector(#9021)UnnecessaryTernaryExpressionRector(#9024)->reportUnusedSkips()now works with the default parallel run, not only with--debugorwithoutParallel()(#8957)Bugfixes 🐛
Core
fetchClassLikeReflection()(#8965) Thanks @hmennen90--clear-cacherun (#8934)instanceofand binary ops (#9005) Thanks @odolbeauDeadCode
RemoveUnusedPrivatePropertyRector(#9025)clonestatement inRemoveDeadStmtRector(#9023, #9044)RemoveUnusedPromotedPropertyRector(#9022)RemoveEmptyClassMethodRector(#9036)RemoveDeadLoopRector(#9041)RemoveDeadIfBlockRector(#9042)RemoveDuplicatedCaseInSwitchRector(#9020)BooleanAndin trait onRemoveAlwaysTrueIfConditionRector(#9003) Thanks @odolbeauPHP_VERSION_IDcheck that can fail on the minimum version inRemovePhpVersionIdCheckRector(#9054)==and!=inUnwrapFutureCompatibleIfPhpVersionRector(#9053)CodeQuality
SimplifyEmptyCheckOnEmptyArrayRector(#9060)BooleanNotIdenticalToNotIdenticalRector(#9043)InlineIsAInstanceOfRector(#9032)SimplifyBoolIdenticalTrueRector(#9029)SingularSwitchToIfRector(#9019)UnwrapSprintfOneArgumentRector(#9018)NegatedAndsToPositiveOrsRector(#9011)CodingStyle, TypeDeclaration, EarlyReturn, Privatization
FunctionFirstClassCallableRector(#9057)ClosureFromCallableToFirstClassCallableRector(#9045)AddMethodCallBasedStrictParamTypeRector(#9048)PreparedValueToEarlyReturnRector(#9033)private protected(set)on asymmetric visibility property onPrivatizeFinalClassPropertyRector(#8935)PHP sets
clamp()only when min <= max is proven inMinMaxToClampRector(#9058)ChrArgModuloRector(#8963)ArrayToFirstClassCallableRector(#9035)ClassPropertyAssignToConstructorPromotionRector(#9049)ChangeSwitchToMatchRector(#9056)<inVersionCompareFuncCallArgumentRector(#9055)ArrayKeysToArrayKeyFirstLastRector(#9046)IsCountableRectorandIsIterableRector(#9038)RandomFunctionRector(#9016){as literal inEregToPcreTransformer(#8964) Thanks @hmennen90Removed 💀
Rules deprecated in 2.8 are now removed. Each already threw an exception on use.
SetList::PHP_*,SetList::NAMING,SetList::EARLY_RETURN,SetList::INSTANCEOFandSetList::IFconstants (#8955, #8972, #8973)withSetProviders()(#8954)githubandgitlaboutput formats (#8953)attributeClassparam fromPhpAttributeGroupFactory::createArgsFromItems()(#9000)Deprecations⚠️
LevelSetListin favor ofwithPhpSets()/withPhpLevel()(#9001)RenameStringRector, replaced by dedicated rule (#8974)StaticCallToNewRector,WrapReturnRectorandAttributeKeyToClassConstFetchRector(#8962, #8960, #8956)FuncCallToConstFetchRectorand removephp_sapi_name()/pi()to constant conversion (#8959)NewlineAfterStatementRector, as it better fits a coding standard tool (#8975)Internals ⚙️
Configuration(#9031)RectorStyleinstead ofSymfonyStylein services (#9030)ArgvInput(#9027)e(#8936) Thanks @staabmrector-symfony 🎵
EmailModeToConstantRector(#1105)ResponseCreateToNewRector(#1107)PreviousAdminRoleToIsImpersonatorRectorto replaceRenameStringRectorconfig (#1129)GetExtendedTypesReturnArrayRector(#1106)ConstraintOptionsToNamedArgumentsRector(#1133)EventSubscriberToAttributeRectoron symfony/framework-bundle, not event-dispatcher alone (#1132) Thanks @bbralarector-phpunit 🟢
AddDoesNotPerformAssertionToNonAssertingTestRector(#834)SuffixMockObjectPropertyRector,ConfiguredMockEntityToSetterObjectRector,AllowMockObjectsWithoutExpectationsAttributeRector,ReplaceTestFunctionPrefixWithAttributeRector,RemoveNamedArgsInDataProviderRector,WillReturnCallbackFallbackToThrowRectorandBehatPHPUnitAssertToWebmozartRector(#835 - #841)rector-doctrine 🗃️
ColumnTypeToTypesConstantRector(#549)AddArrayResultColumnNamesRector,RemoveEmptyTableAttributeRector,YamlToAttributeDoctrineMappingRector,CodeQualityEnumDoctrineClass,GetRepositoryServiceLocatorToRepositoryServiceInjectionRector,MoveCurrentDateTimeDefaultInEntityToConstructorRectorandTypeNullableEntityFromDocblockRector(#550 - #556)rector-downgrade-php ⬇️
DowngradeNewMethodCallWithoutParenthesesRector(#424)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.