Skip to content

Update dependency rector/rector to ^2.5.6#357

Merged
renovate[bot] merged 1 commit into
mainfrom
deps/all
Jul 12, 2026
Merged

Update dependency rector/rector to ^2.5.6#357
renovate[bot] merged 1 commit into
mainfrom
deps/all

Conversation

@renovate

@renovate renovate Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
rector/rector (source) ^2.5.5^2.5.6 age 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
    • At any time (no schedule defined)
  • 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.

@renovate renovate Bot enabled auto-merge (squash) July 12, 2026 11:28
@renovate renovate Bot merged commit 0588fa7 into main Jul 12, 2026
10 checks passed
@renovate renovate Bot deleted the deps/all branch July 12, 2026 11:30
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.00%. Comparing base (8510a1c) to head (29b08b6).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #357   +/-   ##
=======================================
  Coverage   97.00%   97.00%           
=======================================
  Files           6        6           
  Lines         501      501           
=======================================
  Hits          486      486           
  Misses         15       15           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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.

1 participant