Skip to content

Commit 0f84297

Browse files
committed
more tests
1 parent f091019 commit 0f84297

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Diff for: tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php

+4
Original file line numberDiff line numberDiff line change
@@ -2073,6 +2073,10 @@ public function testBug12847(): void
20732073
39,
20742074
'mixed is empty.',
20752075
],
2076+
[
2077+
'Parameter #1 $array of function Bug12847\doSomething expects non-empty-array<mixed>, stdClass given.',
2078+
46,
2079+
],
20762080
]);
20772081
}
20782082

Diff for: tests/PHPStan/Rules/Functions/data/bug-12847.php

+7
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ function doExplicitMixed(mixed $mixed): void
4040
}
4141
}
4242

43+
function doStdClass(\stdClass $stdClass): void
44+
{
45+
if (isset($stdClass['def'])) {
46+
doSomething($stdClass);
47+
}
48+
}
49+
4350
/**
4451
* @param non-empty-array<mixed> $array
4552
*/

0 commit comments

Comments
 (0)