Skip to content
Permalink
Browse files

Break apart reconciler

  • Loading branch information...
muglug committed Aug 10, 2019
1 parent 3cf160c commit 60c0133fff20359ac510b122ac2a730e4d3e4e7d
@@ -12,7 +12,7 @@
use Psalm\Internal\Analyzer\StatementsAnalyzer;
use Psalm\Internal\Clause;
use Psalm\Storage\FunctionLikeStorage;
use Psalm\Type\Reconciler;
use Psalm\Internal\Type\AssertionReconciler;
use Psalm\Type\Union;
use function strpos;
use function strtolower;
@@ -538,7 +538,7 @@ public static function filterClauses(
break;
}
$result_type = Reconciler::reconcileTypes(
$result_type = AssertionReconciler::reconcile(
$type,
clone $new_type,
null,
@@ -32,6 +32,7 @@
use Psalm\Type\Atomic\TNull;
use Psalm\Type\Atomic\TNumeric;
use Psalm\Type\Reconciler;
use Psalm\Internal\Type\AssertionReconciler;
use Psalm\Internal\Type\TypeCombination;
use function array_merge;
use function array_diff_key;
@@ -279,7 +280,7 @@ function ($var_id) use ($original_vars_in_scope) {
$var_id = ExpressionAnalyzer::getVarId($stmt->left->var, $context->self);
if ($var_id && isset($pre_op_context->vars_in_scope[$var_id])) {
$left_inferred_reconciled = Reconciler::reconcileTypes(
$left_inferred_reconciled = AssertionReconciler::reconcile(
'!falsy',
clone $pre_op_context->vars_in_scope[$var_id],
'',
@@ -487,7 +488,7 @@ function (\Psalm\Internal\Clause $c) use ($mixed_var_ids) {
$lhs_type = null;
if (isset($stmt->left->inferredType)) {
$if_return_type_reconciled = Reconciler::reconcileTypes(
$if_return_type_reconciled = AssertionReconciler::reconcile(
'!null',
$stmt->left->inferredType,
'',
@@ -10,6 +10,7 @@
use Psalm\Type;
use Psalm\Type\Algebra;
use Psalm\Type\Reconciler;
use Psalm\Internal\Type\AssertionReconciler;
use function array_merge;
use function array_map;
use function array_diff_key;
@@ -308,7 +309,7 @@ function (\Psalm\Internal\Clause $c) use ($mixed_var_ids) {
$lhs_type = $stmt->if->inferredType;
}
} elseif (isset($stmt->cond->inferredType)) {
$if_return_type_reconciled = Reconciler::reconcileTypes(
$if_return_type_reconciled = AssertionReconciler::reconcile(
'!falsy',
clone $stmt->cond->inferredType,
'',

0 comments on commit 60c0133

Please sign in to comment.
You can’t perform that action at this time.