Skip to content

Commit 6cfc99b

Browse files
staabmondrejmirtes
authored andcommitted
more tests
1 parent feca73d commit 6cfc99b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/PHPStan/Analyser/nsrt/narrow-tagged-union.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ class HelloWorld
99
/** @param array{string, '', non-empty-string}|array{string, numeric-string} $arr */
1010
public function sayHello(array $arr): void
1111
{
12+
if (count($arr) === 0) {
13+
assertType('*NEVER*', $arr);
14+
} else {
15+
assertType("array{string, '', non-empty-string}|array{string, numeric-string}", $arr);
16+
}
17+
assertType("array{string, '', non-empty-string}|array{string, numeric-string}", $arr);
18+
1219
if (count($arr) === 1) {
1320
assertType('*NEVER*', $arr);
1421
} else {

0 commit comments

Comments
 (0)