Skip to content

[TASK] Update rector/rector to v2.5.7#282

Merged
renovate[bot] merged 1 commit into
mainfrom
renovate/patch-rector-packages
Jul 13, 2026
Merged

[TASK] Update rector/rector to v2.5.7#282
renovate[bot] merged 1 commit into
mainfrom
renovate/patch-rector-packages

Conversation

@renovate

@renovate renovate Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
rector/rector (source) 2.5.62.5.7 age adoption passing confidence

Release Notes

rectorphp/rector (rector/rector)

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)



Configuration

📅 Schedule: (UTC)

  • Branch creation
    • Monday through Friday (* * * * 1-5)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Enabled.

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.


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

This PR was generated by Mend Renovate. View the repository job log.

| datasource | package       | from  | to    |
| ---------- | ------------- | ----- | ----- |
| packagist  | rector/rector | 2.5.6 | 2.5.7 |
@renovate renovate Bot added the dependencies Updates project dependencies label Jul 13, 2026
@renovate
renovate Bot enabled auto-merge (squash) July 13, 2026 16:01
@renovate
renovate Bot merged commit 4904645 into main Jul 13, 2026
11 checks passed
@renovate
renovate Bot deleted the renovate/patch-rector-packages branch July 13, 2026 16:02
@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 29264728589

Coverage remained the same at 97.619%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 168
Covered Lines: 164
Line Coverage: 97.62%
Coverage Strength: 2.35 hits per line

💛 - Coveralls

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

Labels

dependencies Updates project dependencies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant