1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +01:00

Catch exception in more places

This commit is contained in:
Matthew Brown 2019-01-08 09:57:14 -05:00
parent a89a201c71
commit b6865b130b
2 changed files with 10 additions and 2 deletions

View File

@ -39,7 +39,11 @@ class AlgebraAnalyzer
PhpParser\Node $stmt,
array $new_assigned_var_ids
) {
$negated_formula2 = Algebra::negateFormula($formula2);
try {
$negated_formula2 = Algebra::negateFormula($formula2);
} catch (\Psalm\Exception\ComplicatedExpressionException $e) {
return;
}
$formula1_hashes = [];

View File

@ -243,7 +243,11 @@ class IfAnalyzer
// define this before we alter local claues after reconciliation
$if_scope->reasonable_clauses = $if_context->clauses;
$if_scope->negated_clauses = Algebra::negateFormula($if_clauses);
try {
$if_scope->negated_clauses = Algebra::negateFormula($if_clauses);
} catch (\Psalm\Exception\ComplicatedExpressionException $e) {
$if_scope->negated_clauses = [];
}
$if_scope->negated_types = Algebra::getTruthsFromFormula(
Algebra::simplifyCNF(