Skip to content

Commit 0ec04f8

Browse files
clxmstaabondrejmirtes
authored andcommitted
more testcoverage
1 parent ebb1d9f commit 0ec04f8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/PHPStan/Analyser/data/bug-6439.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,21 @@ public function testLimit(string $s15, string $s16, string $s17) {
5353
assertType("literal-string&non-empty-string", $s17);
5454
}
5555

56+
/**
57+
* @param '1'|'2' $s2
58+
*/
59+
public function appendEmpty($s2) {
60+
if (rand(0,1)) {
61+
$s2 .= '';
62+
}
63+
assertType("'1'|'2'", $s2);
64+
65+
if (rand(0,1)) {
66+
$s2 = '';
67+
}
68+
assertType("''|'1'|'2'", $s2);
69+
}
70+
5671
public function concatCase() {
5772
$extra = '';
5873
if (rand(0,1)) {

0 commit comments

Comments
 (0)