Skip to content

chore(deps): update dependency rector/rector to v2.9.3 - #84

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/rector-rector-2.x-lockfile
Open

renovate[bot] wants to merge 1 commit into
mainfrom
renovate/rector-rector-2.x-lockfile

Conversation

@renovate

@renovate renovate Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
rector/rector (source) 2.8.5 → 2.9.3 age adoption passing confidence

Release Notes

rectorphp/rector (rector/rector)

v2.9.3: Released Rector 2.9.3

Compare 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-config command, Pest support, and switch to a new console framework.


New Features 🥳

  • [DX] Add dump-config command to print the resolved Rector configuration as JSON (#​9071)
vendor/bin/rector dump-config
  • [DX] Support --config in dump-config, list-rules and validate-config commands (#​9103)

  • [Php55] Extend StringClassNameToClassConstantRector to handle class method references, concatenated class method prefixes and references to the current class (#​9066, #​9068, #​9069, #​9070)

- $callback = 'App\Service\SomeService::run';
+ $callback = \App\Service\SomeService::class . '::run';
  • [Renaming] Support case-insensitive class and constant name matching in RenameClassRector and RenameConstantRector (#​9111, #​9112)

  • [Set] Add Pest support to composer-based sets (#​9119, #​9120)

return RectorConfig::configure()
    ->withComposerBased(pest: true);

Smarter Caching ⚡

  • Invalidate cached files when their parent class, interface or trait changes (#​9090)
  • Track traits used by parent classes and nested traits as file dependencies (#​9092)
  • Clear the cache before constructing rules when running with --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:

  • Keep necessary boolean casts in UnnecessaryTernaryExpressionRector (#​9134)
  • Avoid removing instanceof assertions based solely on PHPDoc types in RemoveDeadInstanceOfAssertRector (#​9124)
  • Keep conditions in RemoveAlwaysTrueIfConditionRector when their types are only guaranteed by PHPDoc (#​9125)
  • Avoid removing potentially reachable loops in RemoveDeadLoopRector (#​9139)
  • Avoid declaring return types based on PHPDoc-only array shapes in AddArrowFunctionReturnTypeRector (#​9167)
  • Keep unused private method parameters when PHPDoc-only typed callers prevent safe removal (#​9160, #​9165)

The goal stays the same: prefer keeping code unchanged over making a potentially unsafe change.


Bugfixes 🐛

Core
  • Fix missing scope for unreachable statements after labels (#​8971)
  • Fill scope on trait-level attribute arguments (#​9091)
  • Keep necessary skips when two skipped rules would perform the same change (#​9072)
  • Preserve tab indentation of reprinted nodes (#​9087)
  • Preserve heredoc content indentation in BetterStandardPrinter (#​9102)
  • Fix indentation of multiline method call arguments printed on a new line (#​9117)
CodeQuality
  • Handle constant definitions in InlineIfToExplicitIfRector (#​9078)
  • Skip floats in SimplifyTautologyTernaryRector (#​9084)
  • Use || when converting negated multi-argument isset() in IssetOnPropertyObjectToPropertyExistsRector (#​9098)
DeadCode
  • Preserve parentheses around cast expressions in RecastingRemovalRector (#​9094)
CodingStyle and TypeDeclaration
  • [CodingStyle] Simplify shadowed function detection in FunctionFirstClassCallableRector (#​9067)
  • [CodingStyle] Skip consecutive static assignments of the same class in NewlineBeforeNewAssignSetRector (#​9118)
  • [TypeDeclaration] Skip non-array, possibly object and template types in AddArrowFunctionParamArrayWhereDimFetchRector (#​9073, #​9074)
PHP sets
  • [Php85] Skip increment, decrement, by-reference usage and other write contexts in ArrayFirstLastRector (#​9079, #​9080, #​9081)
  • [Php83] Skip get_parent_class() in classes without a parent in RemoveGetClassGetParentClassNoArgsRector (#​9101)
  • [Php81] Skip vendor MyCLabs enum method calls in MyCLabsMethodCallToEnumConstRector (#​9086, #​9088)
  • [Php80] Preserve loose comparison behavior in ChangeSwitchToMatchRector (#​9065)
  • [Php74] Skip closures in constant expressions in ClosureToArrowFunctionRector (#​9097)
  • [Php71] Limit BinaryOpBetweenNumberAndStringRector to arithmetic and bitwise operators (#​9114)
  • Preserve surrounding string content when converting backreferences in PregReplaceEModifierRector (#​9100)
  • Preserve the original create_function() scope in CreateFunctionToAnonymousFunctionRector (#​9099)

Developer Experience ✨

  • Improve the deprecation message for per-version PHP sets registered through withSets() (#​9089)
  • Include treatClassesAsFinal() and withSymfonyContainerXml() configuration in dump-config output (#​9109, #​9115)
  • Extend composer-based package detection for Symfony and Doctrine packages (#​9093, #​9110, #​9113)

Removed 💀

  • Remove deprecated --rules-summary option (#​9095)
  • Remove internal SetList::PHP_POLYFILLS constant (#​9064)

Internals ⚙️

  • Replace symfony/console with the entropy/entropy console framework (#​8787)
  • Bump PHP-Parser to 5.10 (#​9082)
  • Bump PHPStan to 2.4 (#​9166)
  • Bump PHPDoc Parser to 2.6 (#​9168)
  • Use CallLike::getArg() for named and positional argument resolution across rules (#​9075)
  • Restore static configuration parameters after ConfigDumperTest to prevent test isolation issues (#​9077)

Full Changelog: rectorphp/rector@2.9.2...2.9.3

v2.9.2: Released Rector 2.9.2

Compare Source

Bugfixes 🐛

  • [CodeQuality] Remove NarrowPreviousExceptionCodeArgRector, as it changes getCode() of new exception to 0 (#​9062), reported in #​9061

    PHP does not inherit the code from the previous exception, so new X('msg', previous: $e) returns 0 from getCode(), not $e->getCode(). The rule was part of the named-args set 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 in ThrowWithPreviousExceptionRector (#​9063)

v2.9.1

Compare Source

v2.9.0: Released Rector 2.9.0

Compare 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.php still 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 🥳

  • [CodeQuality] Add 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);
 }
  • [Php84] Handle property fetch, static access, array access and invocation on NewMethodCallWithoutParenthesesRector (#​9009, #​9010) Thanks @​alexndlm
-$message = (new Regex('some-pattern'))->message;
-$constant = (new Request())::METHOD_GET;
-$value = (new ArrayObject($items))['key'];
-$result = (new Invokable())();
+$message = new Regex('some-pattern')->message;
+$constant = new Request()::METHOD_GET;
+$value = new ArrayObject($items)['key'];
+$result = new Invokable()();
  • [Php71] Convert partial list() destruct in ListToArrayDestructRector (#​9028)
-list(, $instanceId) = explode(':', $rate->id);
+[, $instanceId] = explode(':', $rate->id);
  • [TypeDeclaration] Allow void on final methods of non-final classes in AddVoidReturnTypeWhereNoReturnRector (#​9051)
 abstract class SomeClass
 {
-    final protected function run()
+    final protected function run(): void
     {
         echo 1;
     }
 }
  • [TypeDeclaration] Use object return type for (object) cast in ReturnTypeFromReturnCastRector (#​9021)
-public function run($data): \stdClass
+public function run($data): object
 {
     return (object) $data;
 }
  • [CodeQuality] Drop redundant bool cast under negation in UnnecessaryTernaryExpressionRector (#​9024)
-return $order ? false : true;
+return !$order;
  • [dx] Report unnecessary skips in parallel runs too - ->reportUnusedSkips() now works with the default parallel run, not only with --debug or withoutParallel() (#​8957)

Bugfixes 🐛

Core
  • Keep the narrowed scope of a ternary branch when a changed node is refreshed (#​9007) Thanks @​SanderMuller
  • Fix class scope refresh skipping class attributes when class node is already in class (#​9004) Thanks @​APX403
  • [Core] Skip classes unknown to reflection instead of crashing in fetchClassLikeReflection() (#​8965) Thanks @​hmennen90
  • [Caching] Fix removed skip not invalidating cache after --clear-cache run (#​8934)
  • [Printer] Wrap compound assign on the left of instanceof and binary ops (#​9005) Thanks @​odolbeau
  • [Php86] Handle crash on partial function application on PHP 8.6 scope set attribute (#​9013)
DeadCode
  • Keep side effects of assigned value in RemoveUnusedPrivatePropertyRector (#​9025)
  • Keep evaluation order of side effects and keep clone statement in RemoveDeadStmtRector (#​9023, #​9044)
  • Keep non-trailing constructor param in RemoveUnusedPromotedPropertyRector (#​9022)
  • Keep empty constructor of extendable class in RemoveEmptyClassMethodRector (#​9036)
  • Keep loops whose condition changes state in RemoveDeadLoopRector (#​9041)
  • Keep empty branch that guards later branches in RemoveDeadIfBlockRector (#​9042)
  • Skip case reached by fall-through in RemoveDuplicatedCaseInSwitchRector (#​9020)
  • Skip BooleanAnd in trait on RemoveAlwaysTrueIfConditionRector (#​9003) Thanks @​odolbeau
  • Keep PHP_VERSION_ID check that can fail on the minimum version in RemovePhpVersionIdCheckRector (#​9054)
  • Compare loosely on == and != in UnwrapFutureCompatibleIfPhpVersionRector (#​9053)
CodeQuality
  • Invert ordering comparisons only on int operands (#​9059)
  • Skip uninitialized typed array property in SimplifyEmptyCheckOnEmptyArrayRector (#​9060)
  • Check negated operand type in BooleanNotIdenticalToNotIdenticalRector (#​9043)
  • Keep original class name in InlineIsAInstanceOfRector (#​9032)
  • Skip self-assign result in SimplifyBoolIdenticalTrueRector (#​9029)
  • Keep loose comparison in SingularSwitchToIfRector (#​9019)
  • Unwrap only percent-free string literal in UnwrapSprintfOneArgumentRector (#​9018)
  • Preserve assignment parentheses in NegatedAndsToPositiveOrsRector (#​9011)
CodingStyle, TypeDeclaration, EarlyReturn, Privatization
  • [CodingStyle] Keep string callable global when shadowed in FunctionFirstClassCallableRector (#​9057)
  • [CodingStyle] Require object in ClosureFromCallableToFirstClassCallableRector (#​9045)
  • [TypeDeclaration] Ignore docblock-narrowed args in AddMethodCallBasedStrictParamTypeRector (#​9048)
  • [EarlyReturn] Skip several ifs assigning the returned variable in PreparedValueToEarlyReturnRector (#​9033)
  • [Privatization] Fix invalid private protected(set) on asymmetric visibility property on PrivatizeFinalClassPropertyRector (#​8935)
PHP sets
  • [Php86] Fold to clamp() only when min <= max is proven in MinMaxToClampRector (#​9058)
  • [Php85] Fix negative value on ChrArgModuloRector (#​8963)
  • [Php81] Skip array returned as array type in ArrayToFirstClassCallableRector (#​9035)
  • [Php80] Keep property type safe in ClassPropertyAssignToConstructorPromotionRector (#​9049)
  • [Php80] Skip int cast of string subject in ChangeSwitchToMatchRector (#​9056)
  • [Php80] Map empty operator to < in VersionCompareFuncCallArgumentRector (#​9055)
  • [Php73] Require non-empty array in ArrayKeysToArrayKeyFirstLastRector (#​9046)
  • [Php71/Php73] Skip call expression in IsCountableRector and IsIterableRector (#​9038)
  • [Php70] Skip seeded files and unordered bounds in RandomFunctionRector (#​9016)
  • [Php70] Treat unescaped { as literal in EregToPcreTransformer (#​8964) Thanks @​hmennen90

Removed 💀

Rules deprecated in 2.8 are now removed. Each already threw an exception on use.


Deprecations ⚠️

  • Deprecate LevelSetList in favor of withPhpSets() / withPhpLevel() (#​9001)
return RectorConfig::configure()
    ->withPhpSets();
  • [Renaming] Deprecate RenameStringRector, replaced by dedicated rule (#​8974)
  • [Transform] Deprecate StaticCallToNewRector, WrapReturnRector and AttributeKeyToClassConstFetchRector (#​8962, #​8960, #​8956)
  • [CodingStyle] Deprecate FuncCallToConstFetchRector and remove php_sapi_name()/pi() to constant conversion (#​8959)
  • [CodingStyle] Deprecate NewlineAfterStatementRector, as it better fits a coding standard tool (#​8975)

Internals ⚙️

  • Build parallel worker command line from Configuration (#​9031)
  • Type hint RectorStyle instead of SymfonyStyle in services (#​9030)
  • Resolve bootstrap CLI options without symfony/console ArgvInput (#​9027)
  • Bump dev dependencies to latest versions (#​8976)
  • Delete leftover file e (#​8936) Thanks @​staabm

rector-symfony 🎵

  • [Symfony52] Add EmailModeToConstantRector (#​1105)
  • [Symfony51] Add ResponseCreateToNewRector (#​1107)
  • [Symfony51] Add PreviousAdminRoleToIsImpersonatorRector to replace RenameStringRector config (#​1129)
  • [Symfony42] Add GetExtendedTypesReturnArrayRector (#​1106)
  • [Symfony73] Keep named arguments next to options array in ConstraintOptionsToNamedArgumentsRector (#​1133)
  • [CodeQuality] Gate EventSubscriberToAttributeRector on symfony/framework-bundle, not event-dispatcher alone (#​1132) Thanks @​bbrala
  • Remove 23 deprecated rules across CodeQuality, Configs, DependencyInjection, JMS, SwiftMailer, Symfony30, Symfony43, Symfony62 and Symfony73 (#​1108 - #​1128, #​1130, #​1131)

rector-phpunit 🟢

  • [PHPUnit60] Skip tests in classes with asserting parent lifecycle methods in AddDoesNotPerformAssertionToNonAssertingTestRector (#​834)
  • Remove 7 deprecated rules: SuffixMockObjectPropertyRector, ConfiguredMockEntityToSetterObjectRector, AllowMockObjectsWithoutExpectationsAttributeRector, ReplaceTestFunctionPrefixWithAttributeRector, RemoveNamedArgsInDataProviderRector, WillReturnCallbackFallbackToThrowRector and BehatPHPUnitAssertToWebmozartRector (#​835 - #​841)

rector-doctrine 🗃️

  • [CodeQuality] Add ColumnTypeToTypesConstantRector (#​549)
  • Remove 7 deprecated rules and classes: AddArrayResultColumnNamesRector, RemoveEmptyTableAttributeRector, YamlToAttributeDoctrineMappingRector, CodeQualityEnumDoctrineClass, GetRepositoryServiceLocatorToRepositoryServiceInjectionRector, MoveCurrentDateTimeDefaultInEntityToConstructorRector and TypeNullableEntityFromDocblockRector (#​550 - #​556)

rector-downgrade-php ⬇️

  • [DowngradePhp84] Handle property fetch, static access, array access and invocation on DowngradeNewMethodCallWithoutParenthesesRector (#​424)

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • 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 was generated by Mend Renovate. View the repository job log.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
php-imgproxy 7f29427 Nov 26 2026, 01:07 AM

@renovate renovate Bot changed the title chore(deps): update dependency rector/rector to v2.9.2 chore(deps): update dependency rector/rector to v2.9.3 Dec 6, 2026
@renovate

renovate Bot commented Dec 6, 2026

Copy link
Copy Markdown
Contributor Author

⚠️ 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
Loading composer repositories with package information
Dependency phpstan/phpstan is also a root requirement. Package has not been listed as an update argument, so keeping locked at old version. Use --with-all-dependencies (-W) to include root dependencies.
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires rector/rector ^2.0 -> satisfiable by rector/rector[2.9.3].
    - rector/rector 2.9.3 requires phpstan/phpstan ^2.4 -> found phpstan/phpstan[2.4.0] but the package is fixed to 2.3.7 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants