Skip to content

Commit f79cfbb

Browse files
committed
Update non-empty-string-str-containing-fns.php
1 parent fd21346 commit f79cfbb

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

tests/PHPStan/Analyser/nsrt/non-empty-string-str-containing-fns.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,27 @@ public function variants(string $s) {
103103
}
104104
assertType('string', $s);
105105

106+
if (strpos($s, '0') === 0) {
107+
assertType('string', $s); // could be non-empty-string
108+
} else {
109+
assertType('string', $s);
110+
}
111+
assertType('string', $s);
112+
113+
if (strpos($s, '0') === 5) {
114+
assertType('non-empty-string', $s); // could be non-falsy-string
115+
} else {
116+
assertType('string', $s);
117+
}
118+
assertType('string', $s);
119+
106120
if (strpos($s, ':') === 5) {
107121
assertType('non-falsy-string', $s);
108122
} else {
109123
assertType('string', $s);
110124
}
111125
assertType('string', $s);
126+
112127
if (strpos($s, ':') !== 5) {
113128
assertType('string', $s);
114129
} else {

0 commit comments

Comments
 (0)