Skip to content

Commit

Permalink
handle every increment/decrement
Browse files Browse the repository at this point in the history
  • Loading branch information
orklah committed Jul 24, 2021
1 parent 8189409 commit 4b660aa
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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()]);
Expand Down

0 comments on commit 4b660aa

Please sign in to comment.