1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

fix positive-numeric assertion

This commit is contained in:
orklah 2021-09-05 19:58:39 +02:00
parent 6d059b9c8f
commit def7d31566

View File

@ -3769,7 +3769,7 @@ class AssertionFinder
if ($var_name !== null) {
if ($superior_value_position === self::ASSIGNMENT_TO_RIGHT) {
if ($superior_value_comparison === 0) {
$if_types[$var_name] = [['positive-numeric', '=int(0)']];
$if_types[$var_name] = [['=positive-numeric', '=int(0)']];
} elseif ($superior_value_comparison === 1) {
$if_types[$var_name] = [['positive-numeric']];
} else {
@ -3883,7 +3883,7 @@ class AssertionFinder
$if_types[$var_name] = [['<' . $inferior_value_comparison]];
} else {
if ($inferior_value_comparison === 0) {
$if_types[$var_name] = [['positive-numeric', '=int(0)']];
$if_types[$var_name] = [['=positive-numeric', '=int(0)']];
} elseif ($inferior_value_comparison === 1) {
$if_types[$var_name] = [['positive-numeric']];
} else {