Skip to content

Commit a6b7c9d

Browse files
committed
test a maybe error
1 parent ef860ba commit a6b7c9d

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

‎tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3007,6 +3007,10 @@ public function testBug11281(): void
30073007
'Parameter #1 $s of function Bug11281Functions\expectsString expects string, string|false given.',
30083008
99,
30093009
],
3010+
[
3011+
'Parameter #1 $i of function Bug11281Functions\takesInt expects int, bool|int|string given.',
3012+
118,
3013+
],
30103014
]);
30113015
}
30123016

‎tests/PHPStan/Rules/Functions/data/bug-11281.php‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,8 @@ function ternaryInVariable(mixed $value, string|false $sf): void
112112

113113
expectsString($result);
114114
}
115+
116+
function testMaybeError(mixed $mixed, string|bool|int $maybeInt): void
117+
{
118+
takesInt( $mixed ?? $maybeInt);
119+
}

0 commit comments

Comments
 (0)