Skip to content

Commit 38a2c12

Browse files
committed
another test
1 parent a58a08a commit 38a2c12

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

tests/PHPStan/Rules/Methods/CallMethodsRuleTest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3900,4 +3900,21 @@ public function testBug6120(): void
39003900
$this->analyse([__DIR__ . '/data/bug-6120.php'], []);
39013901
}
39023902

3903+
public function testBug11463(): void
3904+
{
3905+
$this->checkThisOnly = false;
3906+
$this->checkNullables = true;
3907+
$this->checkUnionTypes = true;
3908+
$this->analyse([__DIR__ . '/../PhpDoc/data/bug-11463.php'], [
3909+
[
3910+
"Parameter #1 \$bar of method Bug11463\FooType::foo() expects 'bar', 'bla' given.",
3911+
32,
3912+
],
3913+
[
3914+
"Parameter #1 \$foo of method Bug11463\BarType::bar() expects 'foo', 'bla' given.",
3915+
35,
3916+
],
3917+
]);
3918+
}
3919+
39033920
}

tests/PHPStan/Rules/PhpDoc/data/bug-11463.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,11 @@ class BarType {
2626
*/
2727
public function bar($foo): string { return $foo; }
2828
}
29+
30+
function doFoo(FooType $foo, BarType $bar): void {
31+
$foo->foo('bar');
32+
$foo->foo('bla');
33+
34+
$bar->bar('foo');
35+
$bar->bar('bla');
36+
}

0 commit comments

Comments
 (0)