Skip to content

Commit 1dfe071

Browse files
committed
another test
1 parent 5f04b25 commit 1dfe071

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/PHPStan/Analyser/nsrt/list-count2.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,21 @@ function sayEqualArrayShapeReversed($arrA, array $arrB): void
102102
}
103103
assertType('list', $arrA);
104104
}
105+
106+
/**
107+
* @param array{int, int, int} $arrA
108+
* @param list $arrB
109+
*/
110+
function sayEqualArrayShapeAfterNarrowedCount($arrA, array $arrB): void
111+
{
112+
if (count($arrB) < 2) {
113+
return;
114+
}
115+
116+
if (count($arrA) == count($arrB)) {
117+
assertType('array{mixed, mixed, mixed}', $arrB);
118+
}
119+
assertType('non-empty-list', $arrB);
120+
}
121+
105122
}

0 commit comments

Comments
 (0)