Skip to content

chore(deps): Update dependency rector/rector to v2.6.2 - #325

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

chore(deps): Update dependency rector/rector to v2.6.2#325
renovate[bot] wants to merge 1 commit into
masterfrom
renovate/rector-rector-2.x-lockfile

Conversation

@renovate

@renovate renovate Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

ℹ️ Note

This PR body was truncated due to platform limits.

This PR contains the following updates:

Package Change Age Confidence
rector/rector (source) 2.5.22.6.2 age confidence

Release Notes

rectorphp/rector (rector/rector)

v2.6.2: Released Rector 2.6.2

Compare Source

The 2.6.0 release introduced composer-based sets. This release finishes the job: every extension package now ships a single composer-based set, and the per-version set providers behind the old guessing game are gone.

use Rector\Config\RectorConfig;

return RectorConfig::configure()
    ->withComposerBased(
        doctrine: true,
        phpunit: true,
        twig: true,
    );

Each rule inside checks composer.json/installed.json on its own and runs only if the installed package version matches its constraint. No SymfonySetList::SYMFONY_63, no picking a PHPUnit version by hand. We're working hard to bring Drupal and Laravel community packages to the same system.


Run only the PHP rules (#​8322)

A new --php option on the process command runs only rules bound to a minimal PHP version — those implementing MinPhpVersionInterface. Useful to split a PHP upgrade from the rest, without a second config:

vendor/bin/rector process src --php --dry-run

New features 🥳

  • [Process] Add --php option to run only PHP version rules (#​8322)
  • [Configuration] Resolve the composer-based set of extension packages in withComposerBased() (#​8332), load Doctrine and Twig composer-based sets (#​8313)
  • [Configuration] Report explicit error when the --only rule exists but is not registered in rector.php (#​8300)
  • [DX] Warn on skipped classes that are not Rector rules (#​8323), include the skipped class name in the message (#​8325)
  • [DX] Show previous exceptions during bootstrap (#​8287)
 [WARNING] This skipped class is not a Rector rule, so it can never be skipped.
           Only classes that implement "Rector\Contract\Rector\RectorInterface"
           can be used in "->withSkip()"

New rules 🎉

rector-src

  • [DeadCode] RemoveRedundantTypeCheckRector (#​8307)
 $securityExpression = $operation->getSecurity();
-if (null === $securityExpression || ! is_string($securityExpression)) {
+if (null === $securityExpression) {
     return;
 }

rector-symfony

  • [Configs] EnableValidationAttributesRector (#​1004)
  • [Symfony 2.8] Rename Simple(Pre|Form)AuthenticatorInterface from Core to Http namespace (#​1031)

rector-phpunit

  • [PHPUnit 12.0] AnyMatcherToNewAnyInvokedCountRector for the deprecated any() matcher (#​764)

Bugfixes 🐛

  • [VersionBonding] Cap polyfill rules by the explicitly picked withPhpSets() version (#​8315) — withPhpSets(php82: true) with symfony/polyfill-php83 installed no longer produces PHP 8.3 code
  • [CodeQuality] Skip InlineConstructorDefaultToPropertyRector on non-final class (#​8310) and on a property defined in the parent when parent::__construct() is called (#​8297)
  • [CodeQuality] Skip SimpleXMLElement on IssetOnPropertyObjectToPropertyExistsRector (#​8284)
  • [DeadCode] Skip RemoveParentDelegatingConstructorRector on protected parent constructor (#​8309)
  • [DeadCode] Skip assert() enforcement that produces NeverType on NarrowWideUnionReturnTypeRector (#​8282)
  • [Php71] Skip AssignArrayToStringRector on a variable re-assigned as string (#​8293)
  • [Php81] Skip ArrayToFirstClassCallableRector when the arg type does not accept a Closure (#​8288), drop the Symfony PHP closure check (#​8291)

Set changes 📈

  • [Php84] Remove DeprecatedAnnotationToDeprecatedAttributeRector from the PHP 8.4 set and polyfills (#​8326)
  • [Php83] Remove AddOverrideAttributeToOverriddenMethodsRector from the PHP 8.3 and polyfill sets (#​8321)
  • [CodeQuality] Move 4 early-return rules to the code quality set (#​8301)
  • [DeadCode] Move RemoveReadonlyPropertyVisibilityOnReadonlyClassRector (#​8289), SimplifyBoolIdenticalTrueRector and UnwrapSprintfOneArgumentRector (#​8285) to the dead-code set
  • [rector-symfony] Convert the last version sets to the composer-based set (#​1021), drop per-version composer-triggered sets (#​1010), remove unused version-based set constants and configs (#​1019)
  • [rector-phpunit] Move every per-version rule into the composer-based set (#​758), remove per-version set configs and constants (#​760), register PropertyExistsWithoutAssertRector in the composer-based set (#​761)
  • [rector-symfony] Add JMS attribute rules to the set, bond three attribute rules to package versions (#​1029)

Deprecations 💀

Deprecated rules run without any effect, and print a warning and will be removed in a future major release.
These were deprecated as not part of any set, risky, opinionated or excluded by most users. The goal is to keep Rector valuable and reliable for the every day user.

rector-src

  • DeprecatedAnnotationToDeprecatedAttributeRector and ConstAndTraitDeprecatedAttributeRector (#​8347)
  • AddInterfaceByTraitRector (#​8346)
  • RemoveAnnotationRector (#​8345)
  • ScalarValueToConstFetchRector (#​8344)
  • FuncCallToMethodCallRector (#​8343)
  • AddReturnArrayDocblockBasedOnArrayMapRector (#​8342)
  • AddAssertArrayFromClassMethodDocblockRector (#​8341)
  • AddParamArrayDocblockBasedOnArrayMapRector (#​8340)
  • AddReturnDocblockForDimFetchArrayFromAssignsRector (#​8338)
  • AddSensitiveParameterAttributeRector (#​8337)
  • PropertyHookRector — property hooks are a matter of preference (#​8331)
  • JsonThrowOnErrorRector — can cause BC breaks (#​8327)
  • CoalesceToTernaryRector — risky (#​8324)
  • [EarlyReturn] ChangeNestedIfsToEarlyReturnRector (#​8304), ChangeNestedForeachIfsToEarlyContinueRector (#​8303), ReturnBinaryOrToEarlyReturnRector (#​8302), ChangeOrIfContinueToMultiContinueRector (#​8299)
  • [Strict] DisallowedEmptyRuleFixerRector (#​8290)
  • [Php85] NestedFuncCallsToPipeOperatorRector and SequentialAssignmentsToPipeOperatorRector (#​8286)
  • [CodeQuality] SwitchNegatedTernaryRector (#​8283)
  • cacheClass() — the file-vs-memory cache storage choice moved into CacheFactory; only FileCacheStorage is ever useful to end users (#​8311)
  • symfonyRoute and symfonyValidator args in withAttributesSets() (#​8317)
  • ComposerTriggeredSet in favor of ComposerPackageConstraintInterface (#​8296)
  • withComposerBased(netteUtils:) argument (#​8329)

rector-symfony

  • ActionSuffixRemoverRector (#​1022)
  • ControllerMethodInjectionToConstructorRector (#​1020)
  • TraitGetByTypeToInjectRector (#​1002)
  • RemoveDefaultGetBlockPrefixRector (#​1017)
  • SwiftMailer to Symfony Mailer set (#​1026)

rector-doctrine

  • RemoveEmptyTableAttributeRector (#​505)
  • MoveCurrentDateTimeDefaultInEntityToConstructorRector, drop the force_nullable option (#​504)

Removals 💀

  • Drop the nette/utils set and its single UtilsJsonStaticCallNamedArgRector rule (#​8329) — the only third-party-library rule left in rector-src, readability only
  • Remove deprecated NewInInitializerRector (#​8328)
  • [Sets] Remove the PHP and core set providers (#​8320), the Symfony per-version providers (#​8292), SymfonySetProvider, PHPUnitSetProvider (#​8295) and DoctrineSetProvider (#​8298) from the collector
  • [rector-symfony] Remove TwigSetProvider (#​1015) and the empty Symfony per-version set providers (#​1012)
  • [rector-phpunit] Remove deprecated PHPUnitSetProvider (#​759)
  • [rector-doctrine] Remove DoctrineSetProvider (#​501), drop the unused symfony/yaml dependency (#​500)

rectorphp/rector-symfony 🎵

  • [Symfony 7.3] Merge AsTwigFilter/AsTwigFunction rules into a single rule, add getTests() support (#​1027), restore the merged rules as deprecated (#​1028)
  • [CodeQuality] ControllerMethodInjectionToConstructorRector: re-use the parent protected property (#​1003), skip event and session params (#​1005), use #[Required] autowire() when the parent has a constructor (#​1006), skip type-guarded classes and use a unique autowire method name (#​1007), re-use an existing #[Required] method (#​1008)
  • [CodeQuality] LoadValidatorMetadataToAttributeRector: skip non-constant constraint args (#​1000) and constraints without their own constructor (#​1001)
  • [Sets] Fix AddParamTypeDeclaration to nullable types where the upstream param defaults to null (#​1023)
  • [Symfony30] Skip methods without return in GetRequestRector (#​1013), move it to the Symfony 2.5 set (#​1009)
  • [Twig] Fix truncated Twig_Tests_EnvironmentTest_Extension rename (#​1016)

rectorphp/rector-phpunit 🧪

  • [PHPUnit 6.0] AddDoesNotPerformAssertionToNonAssertingTestRector: add the attribute directly and skip traits (#​765), remove addToAssertionCount() calls (#​763), skip Twig IntegrationTestCase children (#​762)

Internals and CI 🧰

  • [Testing] Check fixtures use the *.php.inc suffix, not bare *.inc (#​8306)
  • [e2e] Trim low-value e2e tests, fold --only quote variants, revive the orphaned rules-summary test (#​8334), remove the attributes e2e test (#​8333)
  • [Scripts] Add list-non-composer-based-rules.php (#​8276)
  • [ci] Bump actions/checkout to v5 for Node.js 24 (#​8335), bump outdated actions to current majors (#​8336), bump lock-threads, stale and typos actions (#​8339)

v2.6.1: Released Rector 2.6.1

Compare Source

Bugfix 🐛

  • [composer-based] Fix fatal error in the composer-based command on a lazy-initialized property, e.g. PHPStan UnionType::$normalized (#​8280)
PHP Fatal error:  Uncaught Error: Typed property PHPStan\Type\UnionType::$normalized
must not be accessed before initialization in src/Console/Command/ComposerBasedCommand.php:205

Composer-based sets keep growing: Twig, nette/utils and the rest of Symfony 📦

Follow-up release to 2.6.0. The composer-based rollout continues - Twig and nette/utils join, and every remaining Symfony rule now declares the package version its target API was added in.

use Rector\Config\RectorConfig;

return RectorConfig::configure()
    ->withComposerBased(
        doctrine: true,
        netteUtils: true,
        phpunit: true,
        symfony: true,
        twig: true,
    );

The new Twig composer-based set replaces the twig112twig127 → ... → twig30 chain with a single set, where every rule checks the installed twig/twig version:

 final class SomeTwigUse
 {
-    public function run(Twig_Environment $twigEnvironment)
+    public function run(\Twig\Environment $twigEnvironment)
     {
-        return new Twig_SimpleFilter('some_filter', 'strlen');
+        return new \Twig\TwigFilter('some_filter', 'strlen');
     }
 }

Package bonding (composer-based rollout) 📦

  • [NetteUtils] Bind nette/utils rules to the installed package version; nette-utils4.php becomes composer-based.php and is loaded as a single set (#​8275)
  • [rector-symfony] Add Twig composer-based set (#​996)
  • [rector-symfony] Bond the remaining 48 Symfony rules to their composer package version (#​994)
  • [rector-symfony] Register LoadValidatorMetadataToAttributeRector in the composer-based set - the last interface-bonded rule left outside it (#​997)
  • [rector-symfony] Bond ContainerInterfaceServiceToServiceContainerRector to symfony/dependency-injection >=6.0 (#​999)
  • [rector-doctrine] Bond AddGetReferenceTypeRector to doctrine/data-fixtures >=1.6 and the annotation-to-attribute sets to their package constraints (#​497)
  • [rector-doctrine] Bond version-specific rules and configuration to composer package constraints (#​495) *
  • [rector-phpunit] Bond RemoveExpectAnyFromMockRector to PHPUnit 11+ (#​756) *

* landed in 2.6.0, missing from its release notes

The per-version sets are not touched - every rule stays registered where it was.


Set changes 📈

  • [CodingStyle] Remove ConsistentImplodeRector from the coding style level - the swapped implode($array, $glue) signature was removed in PHP 8.0, so the rule belongs to the php80 set only, where it already is (#​8273)
  • [rector-doctrine] Add DoctrineSetList::COMPOSER_BASED constant, remove the empty DOCTRINE_BUNDLE_210 set (#​499)

Bugfixes 🐛

  • [TypeDeclarationDocblocks] Skip docblock reprint when nothing changed in AddParamArrayDocblockFromAssignsParamToParamReferenceRector (#​8271)
  • [rector-symfony] [Symfony44] Fix duplicated return in ConsoleExecuteReturnIntRector on a trailing comment (#​992), plus a fixture for a block comment with a commented-out return (#​993)
  • [rector-symfony] [Symfony44] Skip redundant (int) cast on a match return in ConsoleExecuteReturnIntRector - a match of int constants is a UnionType, so the instanceof IntegerType check missed it (#​998)
 public function execute(InputInterface $input, OutputInterface $output): int
 {
-    return (int) match ($input->getArgument('type')) {
+    return match ($input->getArgument('type')) {
         'a' => 0,
         default => 1,
     };
 }

Deprecations 💀

Deprecated rules still run, but print a warning and will be removed in a future major release.
These are coding standard preferences or opinionated rewrites - a coding standard tool is the better place for them.

rector-src

  • WrapEncapsedVariableInCurlyBracesRector - also removed from the coding style level (#​8272)
 function run($world)
 {
-    echo "Hello $world!";
+    echo "Hello {$world}!";
 }

The actual PHP 8.2 deprecation, ${var}, is covered by VariableInStringInterpolationFixerRector in the php82 set.

  • CountArrayToEmptyArrayComparisonRector - also removed from the coding style level (#​8274)
-count($array) === 0;
-count($array) > 0;
+$array === [];
+$array !== [];
  • ArraySpreadInsteadOfArrayMergeRector - the spread result is harder to read, and ... mid-array looks dangerous in review (#​8277)
-$values = array_merge($firstValues, $secondValues);
+$values = [...$firstValues, ...$secondValues];
  • UnusedForeachValueToArrayKeysRector - also removed from the code quality level (#​8278)
-foreach ($values as $key => $value) {
+foreach (array_keys($values) as $key) {
     $items[$key] = null;
 }

rector-doctrine

  • GetRepositoryServiceLocatorToRepositoryServiceInjectionRector - it resolved the repository class by running a regular expression over the entity file contents (#​498)

Renames 🔄

  • [rector-symfony] ReplaceServiceArgumentRectorContainerInterfaceServiceToServiceContainerRector, no longer configurable (#​999)

Both sets configured it with the same 2 values, for a single Symfony 6.0 BC break - the Psr\Container\ContainerInterface and Symfony\...\DependencyInjection\ContainerInterface aliases of the service_container service were removed. Now hardcoded, and the ReplaceServiceArgument value object is gone.

 use function Symfony\Component\DependencyInjection\Loader\Configurator\service;

-return service(ContainerInterface::class);
+return service('service_container');

v2.6.0: Released Rector 2.6.0

Compare Source

Composer-based sets - let Rector handle upgrade from composer.json 🥳

The main theme of this release: rules that turn themselves on based on the package versions you actually have installed.

Instead of picking a Symfony or PHPUnit set by version number and guessing what applies, register the composer-based set once. Every rule inside checks composer.json/installed.json and only runs if the installed package version matches its constraint.

use Rector\Config\RectorConfig;

return RectorConfig::configure()
    ->withComposerBased(
        doctrine: true,
        phpunit: true,
        symfony: true,
        twig: true,
    );

We're working on full coverage. At the moment, PHPUnit and Symfony rules are already migrated to this approach. Not only rules, but also rule configuration can be bound to a package version:

$rectorConfig->ruleWithConfigurationComposerVersionBound(
    SomeRector::class,
    [...],
    'phpunit/phpunit',
    '>=11.0'
);

To see what is active and why, there is a new command:

vendor/bin/rector composer-based
 Composer package bound rules
 ------------------------------- ----------------- ---------- ----------- --------
  Rule                            Package           Requires   Installed   Active
 ------------------------------- ----------------- ---------- ----------- --------
  RemoveExpectAnyFromMockRector   phpunit/phpunit   >=11.0     11.5.2      yes
  RedirectToRouteRector           symfony/...       >=2.6      7.2.1       yes
 ------------------------------- ----------------- ---------- ----------- --------

 ! [NOTE] 2 of 2 composer package bound items are active

And to run only those rules in a single process:

vendor/bin/rector process --composer-based

New features 🥳

  • [Config] Add ruleWithConfigurationComposerVersionBound() (#​8244)
  • [composer-based] Add composer-based command (#​8246)
  • [composer-based] Report rule configuration bound to installed package version (#​8247)
  • [composer-based] Register each rule only once, add --composer-based process filter (#​8248)
  • [Configuration] Load single composer-based PHPUnit set in withComposerBased() (#​8255)
  • [Configuration] Load single composer-based Symfony set in withComposerBased() (#​8259)
  • [Console] Print composer-based rule configuration on separate full-width line (#​8256)
  • [Testing] Allow a test case to resolve package versions from a standalone composer.json (#​8264)

New rules 🎉

rector-src

  • [DeadCode] RemoveTestsOverriddenPrivateMethodParameterRector (#​8254)

rector-phpunit

  • [CodeQuality] AddIntersectionParamToMockObjectParamRector (#​755)
  • [PHPUnit 11.0] ExpectsParamToMockObjectRector — for private test method params (#​753)
  • [PHPUnit 11.0] MockObjectArgCreateStubToCreateMockRector (#​741)
  • [PHPUnit 11.5] AssertContainsOnlyMethodCallRector (#​738)

rector-symfony

  • [CodeQuality] LoadValidatorMetadataToAttributeRector (#​988)

Bugfixes 🐛

  • [DeadCode] Skip RecastingRemovalRector on array dim fetch value (#​8262)
  • [DeadCode] Skip RemoveDefaultValueFromAssignedPropertyRector on early return in constructor-called method (#​8261)
  • [DeadCode] Skip static property in RemoveDefaultValueFromAssignedPropertyRector (#​8240)
  • [DeadCode] Remove whole assign statement on unused createStub() in tests (#​8257)
  • [NodeAnalyzer] Detect always terminated stmts with statements before the return (#​8260)
  • [Configuration] Resolve --only rule name with shell-eaten backslashes (#​8267)
  • [rector-symfony] Add try/catch fixtures with statements before the return (#​986)
# before: quotes were needed to match rule
vendor/bin/rector p --only="\Rector\CodeQuality\Rector\FuncCall\ChangeArrayPushToArrayAssignRector"

# after: simple class name works as well
vendor/bin/rector p --only \Rector\CodeQuality\Rector\FuncCall\ChangeArrayPushToArrayAssignRector
  • [Composer] Prefer composer.json constraint over outdated installed.json version (#​8242)
  • Fix InstalledPackageResolver cwd fallback lost by promoted property (#​8237)
  • [rector-phpunit] Fix swapped preCondition and postCondition attribute mapping (#​746)
  • [rector-phpunit] Handle test traits in DataProviderAnnotationToAttributeRector (#​751, #​752)

Set changes 📈

  • [Config] Move 3 rules from coding style set to their proper sets — ExplicitPublicClassMethodRector to PHP 5.3, plus one each to code quality and dead code (#​8266)
  • [CodingStyle] Remove MinMaxToClampRector from coding style level (#​8270)
  • [rector-symfony] Add SymfonySetList::COMPOSER_BASED (#​982)
  • [rector-phpunit] Register composer-based set in PHPUnitSetProvider (#​748)

Deprecations 💀

Deprecated rules still run, but print a w and will be removed in a future major release.
These were deprecated as not part of any set, risky, opinionated or excluded by most users. Goal is to make Rector useful more to masses and every day user by having valuable and reliable rules.

rector-src

  • EncapsedStringsToSprintfRector (#​8265)
  • SimplifyRegexPatternRector (#​8263)
  • BinaryOpStandaloneAssignsToDirectRector (#​8269)
  • NullableCompareToNullRector (#​8268)
  • NestedTernaryToMatchRector (#​8241)
  • AddReturnDocblockFromMethodCallDocblockRector (#​8239)
  • Gmagick to Imagick set (#​8252)
  • withPhp53Sets() ... withPhp74Sets() — use withPhpLevel() instead (#​8253)
  • cacheMetaExtension() — reports a warning when used (#​8251)

rector-doctrine

  • YamlToAttributeDoctrineMappingRector (#​492)
  • DoctrineSetList::YAML_TO_ANNOTATIONS set (#​493)

rector-symfony

  • TemplateAnnotationToThisRenderRector (#​989)
  • ReturnDirectJsonResponseRector (#​987)
  • AutowireAttributeRector (#​981)

rector-phpunit

  • WillReturnCallbackFallbackToThrowRector (#​740)
  • ReplaceTestFunctionPrefixWithAttributeRector (#​739)

Removals 💀

  • [depre] Remove strict-booleans set, deprecated since 2025-10 (#​8243)
  • [ChangesReporting] Remove junit output format (#​8250)
  • [rector-doctrine] Remove DoctrineDocBlockResolver, deprecated since 2025-05 (#​491)
  • [rector-symfony] Remove StringExtensionToConfigBuilderRector, deprecated since 2025-10 (#​978)
  • [rector-phpunit] Remove 4 rules deprecated since 2025-10 (#​743)
  • [rector-phpunit] Remove deprecated AssertPropertyExistsRector (#​742)

Package bonding (composer-based rollout)

  • [rector-symfony] Bond version-specific rules to composer package constraints (#​979), include all configured rules in the composer-based set (#​980), bond AddViolationToBuildViolationRector to symfony/validator 2.5 (#​983), add AuthorizationCheckerIsGrantedExtractorRector to the composer-based set (#​985), bond RedirectToRouteRector to symfony/framework-bundle 2.6 (#​991)
  • [rector-phpunit] Bond version-specific rules to composer package constraints (#​754), bond stub and mock rules to phpunit/phpunit >=11.0 (#​750), bond annotation-to-attribute rules to phpunit/phpunit >=10.0 (#​744, #​745), move composer version bound rules to composer-based set (#​747)

v2.5.9: Released Rector 2.5.9

Compare Source

Bugfixes 🐛

  • [DeadCode] Remove unreachable class-like checks in Class_-only rules (#​8217)
  • [CodingStyle] Use native php-parser node API over class reflection (#​8218)
  • [Php80] Remove AstResolver usage on AddParamBasedOnParentClassMethodRector (#​8196)
  • Wire RichParser node visitors via DI factory instead of private property hack (#​8215)
  • [Php80] Skip promoting a property the parent declares without a native type in ClassPropertyAssignToConstructorPromotionRector (#​8232)
  • [DeadCode] Keep empty __construct() in anonymous class that extends parent on RemoveEmptyClassMethodRector (#​8219)
  • [DeadCode] Skip negative zero on RemoveDeadZeroAndOneOperationRector (#​8213)
  • [DeadCode] Skip protected property on non-final class on RemoveDefaultValueFromAssignedPropertyRector (#​8214)
  • [DeadCode] Skip array dim fetch assign on RemoveDefaultValueFromAssignedPropertyRector (#​8212)
  • [DeadCode] Skip if/else in loop on RemoveDefaultValueFromAssignedPropertyRector (#​8211)
  • [DeadCode] Skip early return in constructor on RemoveDefaultValueFromAssignedPropertyRector (#​8209)

Set changes 🗑️

NullToStrictStringFuncCallArgRector out of the PHP 8.1 set (#​8234)

The rule and all its fixtures stay, so it can still be opted into:

->withRules([NullToStrictStringFuncCallArgRector::class])

Deprecations 💀

TypeDeclarationDocblocks: 3 data provider docblock rules (#​8235)

Data provider docblock typing is not relevant to code quality — it increases maintenance cost and decreases readability of the test class.

Deprecated rules:

  • AddReturnArrayDocblockFromDataProviderParamRector
  • AddReturnDocblockDataProviderRector
  • AddParamArrayDocblockFromDataProviderRector

rectorphp/rector-symfony 🎵

  • [Symfony72] Match push() to its own RequestStack variable in PushRequestToRequestStackConstructorRector (#​971)
  • [Symfony44] Skip custom isGranted() service calls in controllers in AuthorizationCheckerIsGrantedExtractorRector (#​973)
  • [Symfony42] Update Cookie fixture after NewToStaticCallRector config removal (#​974)
  • Drop rector/type-perfect, its rules ship in tomasvotruba/type-coverage 2.3 now (#​972)
  • Bump dev dependencies, PHPUnit 13 (#​976)
  • [deps] Bump symfony/config to ^8.1 (#​977)
Deprecated: SimplifyFormRenderingRector (#​975)

The rule removed the explicit ->createView() call when a form was passed to render():

Symfony supports passing the FormInterface directly, but the shorthand is ambiguous and breaks dynamic forms: forms modified in PRE_SET_DATA/POST_SUBMIT listeners and submitted over AJAX end up with a 422 response and no clear error. Keeping the explicit ->createView() call is the reliable form. See symfony/symfony#50542.


rectorphp/rector-phpunit 🧪

  • [PHPUnit 13] Fix class in expectExceptionMessage() rename to TestCase (#​735)

rectorphp/rector-downgrade-php ⬇️

  • [DowngradePhp81] Reference MHASH_* constants by name in DowngradeHashAlgorithmXxHashRector to fix PHP 8.5 deprecation (#​386)

v2.5.8: Released Rector 2.5.8

Compare Source

New Features 🥳

  • [dx] Add "if" set with if/else/ternary rules (#​8199)
  • [DeadCode] Add RemoveDeadInstanceOfAssertRector (#​8202)
  • [DeadCode] Add RemoveDoubleSelfAssignRector (#​8203)
  • [DeadCode] Add RemoveParentDelegatingClassMethodRector (#​8204)
  • [DeadCode] Add RemoveDefaultValueFromAssignedPropertyRector (#​8207)
  • [TypeDeclaration] Fix incomplete type on yield variable + yield from in AddParamTypeBasedOnPHPUnitDataProviderRector (#​8206)

Bugfixes 🐛

  • Fix LogicalToBooleanRector: parenthesize assignments nested under unary/binary operators (#​8184)
  • [TypeDeclaration] Skip trait methods on ParamTypeByMethodCallType rules (#​8189)
  • [Php80] Skip promotion when property type is wider than constructor param on ClassPropertyAssignToConstructorPromotionRector (#​8170), Thanks @​ximki-vinki!
  • [Php85] Skip outer spread on NestedFuncCallsToPipeOperatorRector (#​8191)
  • [DeadCode] Fix crash on float version arg in ConditionResolver (#​8192)
  • Make NestedFuncCallsToPipeOperatorRector minimum depth configurable (#​8193)
  • Fix codeception data provider detection (#​8194), Thanks @​d-mitrofanov-v!
  • Make PHPStan DI-Container available in bootstrap files (#​8190), Thanks @​staabm!
  • [Privatization] Skip Symfony Command protected static property in PrivatizeFinalClassPropertyRector (#​8201)
  • Bump to PHPStan ^2.2.6 and Fix its Container compatibility in RichParser (#​8208)

Removed 💀

  • skip @​ return this on RemoveReturnTagIncompatibleWithNativeTypeRector on Traits (#​8185)
  • [DeadCode] Skip string scalar sub type on RemoveReturnTagIncompatibleWithNativeTypeRector (#​8186)

rectorphp/rector-symfony 🎵

  • [Symfony73] Remove empty configure() method in CommandHelpToAttributeRector (#​969)
  • [Symfony73] Keep AbstractExtension when Twig extension overrides a built-in function/filter (#​968)
  • [Symfony73] Wrap scalar groups option in array in ConstraintOptionsToNamedArgumentsRector (#​967)
  • [Symfony61] Remove empty configure() method even with empty body (#​966)
  • [Symfony61] Remove now empty configure() method in CommandConfigureToAttributeRector (#​965)
  • [CodeQuality] Respect typeGuardedClasses and skip closure-only returns in ResponseReturnTypeControllerActionRector (#​964)
  • [Symfony44] Return 1 instead of (int) false in ConsoleExecuteReturnIntRector (#​963)
  • [CodeQuality] Add union and method call return type support to ResponseReturnTypeControllerActionRector (#​961)
  • [Twig30] Add new set for Twig 30 (#​960), Thanks @​MrYamous

rectorphp/rector-doctrine 🟠


rectorphp/rector-phpunit 🟢

  • [PHPUnit 13] Add PHPUnit 13 config set (#​733)
  • [CodeQuality] Skip super global variables on AssertIssetToSpecificMethodRector (#​732)
  • [CodeQuality] Skip anonymous classes in AssertClassToThisAssertRector (#​729)
  • [CodeQuality] Move AssertClassToThisAssertRector hook from Class_ to ClassMethod (#​728)
  • AssertEqualsToSameRector: skip arrays whose actual value key order is not provably identical (#​727)

v2.5.7: Released Rector 2.5.7

Compare Source

This release sharpens the PHPUnit code-quality sets, adds a focused narrow asserts set, deprecates two blurry Symfony web-test rules, and fixes a handful of docblock false-positives in dead-code removal.

New Features 🎉

PHPUnit: PHPUNIT_NARROW_ASSERTS set

A new set focused on narrowing broad asserts to their specific, more descriptive method — e.g. assertTrue(isset($a['b']))assertArrayHasKey('b', $a). (rector-phpunit #​716)

use Rector\PHPUnit\Set\PHPUnitSetList;

return RectorConfig::configure()
    ->withSets([PHPUnitSetList::PHPUNIT_NARROW_ASSERTS]);

withPreparedSets() gains phpunitNarrowAsserts + phpunitMockToStub

The 2 PHPUnit sets are now toggleable like any other prepared set. (#​8178)

return RectorConfig::configure()
    ->withPreparedSets(
        phpunitNarrowAsserts: true,
        phpunitMockToStub: true,
    );

PHPUnit: flip with($this->callback(...)) on void methods to willReturnCallback()

VoidMethodWithCallbackToWillReturnCallbackRector (renamed + refocused) drops the pointless return value and types the closure as void, matching the mocked void method. (rector-phpunit #​724)

 $this->createMock(SomeClass::class)
     ->method('run')
-    ->with($this->callback(function ($arg) {
-        echo $arg;
-
-        return true;
-    }));
+    ->willReturnCallback(function ($arg): void {
+        echo $arg;
+    });
Console: -v as alias for --version

Since the verbose option was removed, -v now prints the version. (#​8177)

vendor/bin/rector -v

# Rector 2.x.x

Improvements 🔧

  • [StaticTypeMapper] Map phpstan-special scalar types (literal-string, numeric-string, …) to their real PHPStan types instead of a bogus ObjectType, so precise docblocks survive dead-code cleanup (#​8176)
  • [PHPUnit CodeQuality] Verify assert method name exists on the Assert class via reflection before transforming (rector-phpunit #​720)
  • [PHPUnit CodeQuality] Simplify single-statement void callback in CallbackSingleAssertToSimplerRector (rector-phpunit #​722)
  • [PHPUnit CodeQuality] Collapse all instanceof asserts for multiple nullable instances in a single run (rector-phpunit #​721)
  • [PHPUnit CodeQuality] Use atLeast() instead of exactly() in DecorateWillReturnMapWithExpectsMockRector (rector-phpunit #​719)

Bug Fixes 🐛

  • [DeadCode] Preserve generic @return tags in RemoveReturnTagIncompatibleWithNativeTypeRector (#​8183)
  • [DeadCode] Skip templated type in RemoveReturnTagIncompatibleWithNativeTypeRector (#​8180)
  • [DeadCode] Skip PHPStan type alias in RemoveReturnTagIncompatibleWithNativeTypeRector (#​8179)
  • [CodeQuality] Skip abstract class in CompleteDynamicPropertiesRector (#​8182)
  • [Php71] Skip magic @method in RemoveExtraParametersRector (#​8181)
  • [PHPUnit] Skip with() multiple arguments in VoidMethodWithCallbackToWillReturnCallbackRector (rector-phpunit #​725)
  • [PHPUnit] Skip new object instances in NarrowIdenticalWithConsecutiveRector — each new is a fresh instance, collapsing them changes intent (rector-phpunit #​726)
  • [PHPUnit] Skip mock property removal when used in a trait (rector-phpunit #​723)
  • [PHPUnit] Skip nested value compare in CallbackSingleAssertToSimplerRector (rector-phpunit #​718)
  • [PHPUnit] Skip union types in AssertEqualsToSameRector to preserve loose comparison (rector-phpunit #​717)

Deprecations 💀

Symfony: WebTestCaseAssertIsSuccessfulRector + WebTestCaseAssertResponseCodeRector

Both rules hide the asserted behavior and force a different assert method per status code, splitting one clear assertion into several implicit ones. Asserting the HTTP status code directly is clearer and uniform. (rector-symfony #​958)


v2.5.6: Released Rector 2.5.6

Compare Source

New Features 🥳

  • [DeadCode] Add RemoveReturnTagIncompatibleWithNativeTypeRector (#​8172)
 final class SomeClass
 {
-    /**
-     * @return SomeObject
-     */
     public function getName(): string
     {
         return $this->someObject->getName();
     }
 }
  • [TypeDeclarationDocblocks] Add MergePhpstanDocTagIntoNativeRector to merge @phpstan-* doc tags into native tags (#​8171)
 final class SomeClass
 {
     /**
-     * @var Collection
-     *
-     * @phpstan-var Collection<int, string>
+     * @va

> ✂ **Note**
> 
> PR body was truncated to here.


</details>

---

### 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 is behind base branch, 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 was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/ericsizemore/clock).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNDIuMiIsInVwZGF0ZWRJblZlciI6IjQ0LjI0LjAiLCJ0YXJnZXRCcmFuY2giOiJtYXN0ZXIiLCJsYWJlbHMiOlsiZGVwZW5kZW5jeSJdfQ==-->

@renovate renovate Bot added the dependency An issue or pull request targeting dependencies. label Jul 5, 2026
@renovate
renovate Bot force-pushed the renovate/rector-rector-2.x-lockfile branch from 1288aba to e61a62e Compare July 6, 2026 15:03
@renovate renovate Bot changed the title chore(deps): Update dependency rector/rector to v2.5.3 chore(deps): Update dependency rector/rector to v2.5.4 Jul 6, 2026
@renovate
renovate Bot force-pushed the renovate/rector-rector-2.x-lockfile branch from e61a62e to e5082da Compare July 9, 2026 17:43
@renovate renovate Bot changed the title chore(deps): Update dependency rector/rector to v2.5.4 chore(deps): Update dependency rector/rector to v2.5.5 Jul 9, 2026
@renovate renovate Bot changed the title chore(deps): Update dependency rector/rector to v2.5.5 chore(deps): Update dependency rector/rector to v2.5.6 Jul 12, 2026
@renovate
renovate Bot force-pushed the renovate/rector-rector-2.x-lockfile branch from e5082da to 36a2251 Compare July 12, 2026 17:13
@renovate
renovate Bot force-pushed the renovate/rector-rector-2.x-lockfile branch from 36a2251 to 0eb7b22 Compare July 13, 2026 16:58
@renovate renovate Bot changed the title chore(deps): Update dependency rector/rector to v2.5.6 chore(deps): Update dependency rector/rector to v2.5.7 Jul 13, 2026
@renovate renovate Bot changed the title chore(deps): Update dependency rector/rector to v2.5.7 chore(deps): Update dependency rector/rector to v2.5.8 Jul 27, 2026
@renovate

renovate Bot commented Jul 27, 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
Command failed: composer update rector/rector:2.6.2 --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
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.3 -> satisfiable by rector/rector[2.6.2].
    - rector/rector 2.6.2 requires phpstan/phpstan ^2.2.6 -> found phpstan/phpstan[2.2.6, 2.2.7, 2.2.8, 2.2.x-dev] but the package is fixed to 2.2.3 (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.

@renovate renovate Bot changed the title chore(deps): Update dependency rector/rector to v2.5.8 chore(deps): Update dependency rector/rector to v2.5.9 Jul 30, 2026
@renovate renovate Bot changed the title chore(deps): Update dependency rector/rector to v2.5.9 chore(deps): Update dependency rector/rector to v2.6.1 Aug 7, 2026
@renovate renovate Bot changed the title chore(deps): Update dependency rector/rector to v2.6.1 chore(deps): Update dependency rector/rector to v2.6.2 Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependency An issue or pull request targeting dependencies.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants