Skip to content

[CodeQuality] Produce void callbacks with bare return in WithCallbackIdenticalToStandaloneAssertsRector#712

Merged
TomasVotruba merged 1 commit into
mainfrom
void-callback-return
Jul 12, 2026
Merged

[CodeQuality] Produce void callbacks with bare return in WithCallbackIdenticalToStandaloneAssertsRector#712
TomasVotruba merged 1 commit into
mainfrom
void-callback-return

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Change WithCallbackIdenticalToStandaloneAssertsRector output: the generated $this->callback(...) closure now has a void return type and a bare return; instead of : bool / return true;.

 ->with($this->callback(function (array $args): bool {
-    return count($args) === 2 && $args[0] === 'correct';
+ ->with($this->callback(function (array $args): void {
+    $this->assertCount(2, $args);
+    $this->assertSame('correct', $args[0]);
+
+    return;
 }));

@TomasVotruba TomasVotruba merged commit 318378f into main Jul 12, 2026
8 checks passed
@TomasVotruba TomasVotruba deleted the void-callback-return branch July 12, 2026 09:54
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