Skip to content

Commit 499d9ef

Browse files
committed
more tests
1 parent de109b6 commit 499d9ef

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/PHPStan/Analyser/nsrt/bug11488.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,28 @@
66

77
class Foo
88
{
9+
/**
10+
* @param array{mixed}|array{0: mixed, 1?: string|null} $row
11+
*/
12+
protected function testOptionalKeys(array $row): void
13+
{
14+
if (count($row) === 1) {
15+
assertType('array{0: mixed, 1?: string|null}', $row);
16+
}
17+
18+
if (count($row) !== 1) {
19+
assertType('array{0: mixed, 1?: string|null}', $row);
20+
}
21+
22+
if (count($row) !== 2) {
23+
assertType('array{0: mixed, 1?: string|null}', $row);
24+
}
25+
26+
if (count($row) !== 3) {
27+
assertType('array{0: mixed, 1?: string|null}', $row);
28+
}
29+
}
30+
931
/**
1032
* @param array{mixed}|array{mixed, string|null, mixed} $row
1133
*/

0 commit comments

Comments
 (0)