Skip to content

[CodeQuality] Add BareCreateMockAssignToDirectUseRector to phpunit-mock-to-stub set#708

Merged
TomasVotruba merged 1 commit into
mainfrom
add-bare-createmock-to-mock-stub-set
Jul 11, 2026
Merged

[CodeQuality] Add BareCreateMockAssignToDirectUseRector to phpunit-mock-to-stub set#708
TomasVotruba merged 1 commit into
mainfrom
add-bare-createmock-to-mock-stub-set

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Adds BareCreateMockAssignToDirectUseRector to the phpunit-mock-to-stub set.

Inlines a bare createMock() assign directly into the single call that uses it:

 public function test()
 {
-    $someObject = $this->createMock(SomeClass::class);
-    $this->process($someObject);
+    $this->process($this->createMock(SomeClass::class));
 }

@TomasVotruba TomasVotruba enabled auto-merge (squash) July 11, 2026 09:45
@TomasVotruba TomasVotruba merged commit a741141 into main Jul 11, 2026
8 checks passed
@TomasVotruba TomasVotruba deleted the add-bare-createmock-to-mock-stub-set branch July 11, 2026 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant