Skip to content

Commit 61b8eb8

Browse files
phpstan-botclaude
authored andcommitted
Add more test cases for bug-11978: too many args and zero args
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4c6e74a commit 61b8eb8

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

tests/PHPStan/Rules/Methods/CallMethodsRuleTest.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3980,7 +3980,16 @@ public function testBug11978(): void
39803980
$this->checkThisOnly = false;
39813981
$this->checkNullables = true;
39823982
$this->checkUnionTypes = true;
3983-
$this->analyse([__DIR__ . '/data/bug-11978.php'], []);
3983+
$this->analyse([__DIR__ . '/data/bug-11978.php'], [
3984+
[
3985+
'Method Bug11978\ViewB::render() invoked with 2 parameters, 0-1 required.',
3986+
25,
3987+
],
3988+
[
3989+
'Method Bug11978\ViewB::render() invoked with 2 parameters, 0-1 required.',
3990+
26,
3991+
],
3992+
]);
39843993
}
39853994

39863995
}

tests/PHPStan/Rules/Methods/data/bug-11978.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ public function renderFoo(string $foo): string
2222
{
2323
$a = $this->view1->render($foo);
2424
$b = $this->view2->render($foo);
25+
$c = $this->view1->render($foo, $foo);
26+
$d = $this->view2->render($foo, $foo);
27+
$e = $this->view1->render();
28+
$f = $this->view2->render();
2529

2630
return $a . $b;
2731
}

0 commit comments

Comments
 (0)