Skip to content

[TASK] Update rector/rector to v2.5.6#281

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

[TASK] Update rector/rector to v2.5.6#281
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.52.5.6 age adoption passing confidence

Release Notes

rectorphp/rector (rector/rector)

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
-     *
-     * @&#8203;phpstan-var Collection<int, string>
+     * @&#8203;var Collection<int, string>
      */
     private $items;
 }

Bugfixes 🐛


PHPUnit 🧪

New rules and changes from rector-phpunit.

New Rules
  • [CodeQuality] Add AssertClassToThisAssertRector (#​707)
 use PHPUnit\Framework\Assert;
 use PHPUnit\Framework\TestCase;

 final class SomeClass extends TestCase
 {
     public function run()
     {
-        Assert::assertEquals('expected', $result);
+        $this->assertEquals('expected', $result);
     }
 }
  • [CodeQuality] Add BareCreateMockAssignToDirectUseRector — inline a single-use createMock() assignment (#​708)
 final class SomeTest extends TestCase
 {
     public function test()
     {
-        $someObject = $this->createMock(SomeClass::class);
-        $this->process($someObject);
+        $this->process($this->createMock(SomeClass::class));
     }

     private function process(SomeClass $someObject): void
     {
     }
 }
  • [CodeQuality] Add WillReturnCallbackFallbackToThrowRector — throw on an unexpected extra consecutive call (#​710)
         $this->someServiceMock->expects($matcher)
             ->method('run')
             ->willReturnCallback(function () use ($matcher) {
                 if ($matcher->numberOfInvocations() === 1) {
                     return 1;
                 }
+
+                throw new \PHPUnit\Framework\Exception(sprintf('Method should not be called for the %dth time', $matcher->numberOfInvocations()));
             });
  • [CodeQuality] Add RemoveReturnFromVoidMethodMockCallbackRector — type a void mock callback and drop its value return (#​711)
         $this->createMock(SomeClass::class)
             ->method('run')
-            ->willReturnCallback(function ($arg) {
+            ->willReturnCallback(function ($arg): void {
                 echo $arg;
-
-                return true;
             });

(SomeClass::run() returns void.)

  • [CodeQuality] Add CallbackSingleAssertToSimplerRector — collapse a with() callback with a sole assertSame() to equalTo() (#​714)
         $builder->expects($this->exactly(2))
             ->method('add')
-            ->with($this->callback(function ($type): bool {
-                $this->assertSame(TextType::class, $type);
-
-                return true;
-            }));
+            ->with($this->equalTo(TextType::class));
Improvements
  • [CodeQuality] Skip TestCase suffix classes in RemoveNeverUsedMockPropertyRector (#​709)
  • [CodeQuality] Produce void callbacks with bare return in WithCallbackIdenticalToStandaloneAssertsRector (#​712)
  • [CodeQuality] Handle return throw and return null in void mock callbacks (#​713)

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.5 | 2.5.6 |
@renovate renovate Bot added the dependencies Updates project dependencies label Jul 13, 2026
@renovate
renovate Bot enabled auto-merge (squash) July 13, 2026 04:33
@renovate
renovate Bot merged commit dfc0c4e into main Jul 13, 2026
11 checks passed
@renovate
renovate Bot deleted the renovate/patch-rector-packages branch July 13, 2026 04:33
@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 29224237243

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

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