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

replace +/- by >/<

This commit is contained in:
orklah 2021-07-31 22:06:36 +02:00
parent 5f764b9d8f
commit 2a9ddab738
2 changed files with 4 additions and 4 deletions

View File

@ -3730,7 +3730,7 @@ class AssertionFinder
}
if ($var_name) {
$if_types[$var_name] = [['=isset'], ['+' . $superior_value_comparison]];
$if_types[$var_name] = [['=isset'], ['>' . $superior_value_comparison]];
}
return $if_types ? [$if_types] : [];
@ -3937,7 +3937,7 @@ class AssertionFinder
}
if ($var_name) {
$if_types[$var_name] = [['=isset'], ['-' . $inferior_value_comparison]];
$if_types[$var_name] = [['=isset'], ['<' . $inferior_value_comparison]];
}
return $if_types ? [$if_types] : [];

View File

@ -102,14 +102,14 @@ class SimpleAssertionReconciler extends \Psalm\Type\Reconciler
);
}
if ($assertion[0] === '+') {
if ($assertion[0] === '>') {
return self::reconcileSuperiorTo(
$existing_var_type,
substr($assertion, 1)
);
}
if ($assertion[0] === '-') {
if ($assertion[0] === '<') {
return self::reconcileInferiorTo(
$existing_var_type,
substr($assertion, 1)