Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3dc3ce6

Browse files
committed
another test
1 parent 774d086 commit 3dc3ce6

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)

AltStyle によって変換されたページ (->オリジナル) /