Skip to content

Commit 1c8e76c

Browse files
committed
Update MutatingScope.php
1 parent c93a336 commit 1c8e76c

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/Analyser/MutatingScope.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@
161161
use function ltrim;
162162
use function md5;
163163
use function sprintf;
164-
use function str_decrement;
165164
use function str_increment;
166165
use function str_starts_with;
167166
use function strlen;
@@ -1736,18 +1735,14 @@ static function (Node $node, Scope $scope) use ($arrowScope, &$arrowFunctionImpu
17361735
foreach ($varScalars as $varValue) {
17371736
if ($node instanceof Expr\PreInc) {
17381737
if (!is_bool($varValue)) {
1739-
if (function_exists('str_increment')) {
1738+
if (function_exists('str_increment') && is_string($varValue)) {
17401739
$varValue = str_increment($varValue);
17411740
} else {
17421741
++$varValue;
17431742
}
17441743
}
17451744
} elseif (is_numeric($varValue)) {
1746-
if (function_exists('str_decrement')) {
1747-
$varValue = str_decrement($varValue);
1748-
} else {
1749-
--$varValue;
1750-
}
1745+
--$varValue;
17511746
}
17521747

17531748
$newTypes[] = $this->getTypeFromValue($varValue);

0 commit comments

Comments
 (0)