Skip to content

Commit fc8643e

Browse files
committed
test different count() variants
1 parent 335960e commit fc8643e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/PHPStan/Analyser/nsrt/bug-13747.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ public function count($list): void
2323

2424
if (count($list, COUNT_NORMAL) > 2) {
2525
assertType('non-empty-list<int>&hasOffsetValue(1, int)&hasOffsetValue(2, int)', $list);
26-
assertType('int<3, max>', count($list));
26+
assertType('int<3, max>', count($list, COUNT_NORMAL));
2727
} else {
2828
assertType('non-empty-list<int>', $list);
2929
}
3030

3131
assertType('non-empty-list<int>', $list);
32-
if (count($list, COUNT_RECURSIVE) > 2) {
33-
assertType('non-empty-list<int>', $list);
34-
assertType('int<1, max>', count($list));
32+
if (count($list, COUNT_RECURSIVE) > 2) { // COUNT_RECURSIVE on non-recursive array
33+
assertType('non-empty-list<int>&hasOffsetValue(1, int)&hasOffsetValue(2, int)', $list);
34+
assertType('int<3, max>', count($list, COUNT_RECURSIVE));
3535
} else {
3636
assertType('non-empty-list<int>', $list);
3737
}

0 commit comments

Comments
 (0)