From a914798d940faeb54643811e0e410bcd20050bd2 Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Tue, 3 Sep 2024 23:52:19 +0200 Subject: [PATCH] Add non regression test --- ...berComparisonOperatorsConstantConditionRuleTest.php | 6 ++++++ tests/PHPStan/Rules/Comparison/data/bug-6642.php | 10 ++++++++++ 2 files changed, 16 insertions(+) create mode 100644 tests/PHPStan/Rules/Comparison/data/bug-6642.php diff --git a/tests/PHPStan/Rules/Comparison/NumberComparisonOperatorsConstantConditionRuleTest.php b/tests/PHPStan/Rules/Comparison/NumberComparisonOperatorsConstantConditionRuleTest.php index ae47818512..4d89a240be 100644 --- a/tests/PHPStan/Rules/Comparison/NumberComparisonOperatorsConstantConditionRuleTest.php +++ b/tests/PHPStan/Rules/Comparison/NumberComparisonOperatorsConstantConditionRuleTest.php @@ -231,4 +231,10 @@ public function testBug6467(): void $this->analyse([__DIR__ . '/data/bug-6467.php'], []); } + public function testBug6642(): void + { + $this->treatPhpDocTypesAsCertain = true; + $this->analyse([__DIR__ . '/data/bug-6642.php'], []); + } + } diff --git a/tests/PHPStan/Rules/Comparison/data/bug-6642.php b/tests/PHPStan/Rules/Comparison/data/bug-6642.php new file mode 100644 index 0000000000..b8ae395d17 --- /dev/null +++ b/tests/PHPStan/Rules/Comparison/data/bug-6642.php @@ -0,0 +1,10 @@ +