From 4b660aa941afdd6081f340c99b009fbc774e73dd Mon Sep 17 00:00:00 2001 From: orklah Date: Sat, 24 Jul 2021 10:51:10 +0200 Subject: [PATCH] handle every increment/decrement --- .../Expression/BinaryOp/NonDivArithmeticOpAnalyzer.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/NonDivArithmeticOpAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/NonDivArithmeticOpAnalyzer.php index 7b59ea2224d..26e22b1f6d9 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/NonDivArithmeticOpAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/NonDivArithmeticOpAnalyzer.php @@ -385,7 +385,12 @@ private static function analyzeNonDivOperands( if ($left_type_part instanceof Type\Atomic\TString && $right_type_part instanceof TInt - && $parent instanceof PhpParser\Node\Expr\PostInc + && ( + $parent instanceof PhpParser\Node\Expr\PostInc || + $parent instanceof PhpParser\Node\Expr\PreInc || + $parent instanceof PhpParser\Node\Expr\PostDec || + $parent instanceof PhpParser\Node\Expr\PreDec + ) ) { if ($left_type_part instanceof Type\Atomic\TNumericString) { $new_result_type = new Type\Union([new TFloat(), new TInt()]);