Skip to content

Commit fda2f70

Browse files
phpstan-botclaude
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 6e1ca1a commit fda2f70

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
@@ -3967,7 +3967,16 @@ public function testBug11978(): void
39673967
$this->checkThisOnly = false;
39683968
$this->checkNullables = true;
39693969
$this->checkUnionTypes = true;
3970-
$this->analyse([__DIR__ . '/data/bug-11978.php'], []);
3970+
$this->analyse([__DIR__ . '/data/bug-11978.php'], [
3971+
[
3972+
'Method Bug11978\ViewB::render() invoked with 2 parameters, 0-1 required.',
3973+
25,
3974+
],
3975+
[
3976+
'Method Bug11978\ViewB::render() invoked with 2 parameters, 0-1 required.',
3977+
26,
3978+
],
3979+
]);
39713980
}
39723981

39733982
}

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)