Commit d161a53 1 parent e3690a7 commit d161a53 Copy full SHA for d161a53
File tree 1 file changed +26
-0
lines changed
1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -1039,6 +1039,32 @@ function getSomething(string $string)
1039
1039
],
1040
1040
'ignored_issues ' => [],
1041
1041
],
1042
+ 'lowercaseStringIsNotNonEmptyWithUnion ' => [
1043
+ 'code ' => '<?php
1044
+ /**
1045
+ * @param string|int $stringOrInt
1046
+ * @psalm-return ($string is non-empty-string|int ? string : int)
1047
+ */
1048
+ function getSomething($stringOrInt)
1049
+ {
1050
+ if (!$stringOrInt) {
1051
+ return 1;
1052
+ }
1053
+ return "";
1054
+ }
1055
+ /** @var string $string */
1056
+ $string;
1057
+ $something = getSomething($string);
1058
+ /** @var non-empty-string $nonEmptyString */
1059
+ $nonEmptyString;
1060
+ $something2 = getSomething($nonEmptyString);
1061
+ ' ,
1062
+ 'assertions ' => [
1063
+ '$something ' => 'int|string ' ,
1064
+ '$something2 ' => 'string ' ,
1065
+ ],
1066
+ 'ignored_issues ' => [],
1067
+ ],
1042
1068
];
1043
1069
}
1044
1070
}
You can’t perform that action at this time.
0 commit comments