From 39d559d5404fb25232966b62b096c98d225d2cad Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Mon, 23 Dec 2024 14:54:27 +0100 Subject: [PATCH] Add tests --- tests/PHPStan/Analyser/nsrt/bug-12312.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/PHPStan/Analyser/nsrt/bug-12312.php b/tests/PHPStan/Analyser/nsrt/bug-12312.php index d5b0bc15d..e6ca6e868 100644 --- a/tests/PHPStan/Analyser/nsrt/bug-12312.php +++ b/tests/PHPStan/Analyser/nsrt/bug-12312.php @@ -14,6 +14,9 @@ public function sayLowercase(string $s): void if ($s != '') { assertType('lowercase-string&non-empty-string', $s); } + if ('' != $s) { + assertType('lowercase-string&non-empty-string', $s); + } assertType('lowercase-string', $s); } @@ -25,6 +28,9 @@ public function sayUppercase(string $s): void if ($s != '') { assertType('non-empty-string&uppercase-string', $s); } + if ('' != $s) { + assertType('non-empty-string&uppercase-string', $s); + } assertType('uppercase-string', $s); } @@ -36,6 +42,9 @@ public function sayBoth(string $s): void if ($s != '') { assertType('lowercase-string&non-empty-string&uppercase-string', $s); } + if ('' != $s) { + assertType('lowercase-string&non-empty-string&uppercase-string', $s); + } assertType('lowercase-string&uppercase-string', $s); } }