mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
Fix #98 - add support for logical and/or
This commit is contained in:
parent
32dd5d5512
commit
2d58531631
@ -723,7 +723,9 @@ class ExpressionChecker
|
||||
) {
|
||||
if ($stmt instanceof PhpParser\Node\Expr\BinaryOp\Concat && $nesting > 20) {
|
||||
// ignore deeply-nested string concatenation
|
||||
} elseif ($stmt instanceof PhpParser\Node\Expr\BinaryOp\BooleanAnd) {
|
||||
} elseif ($stmt instanceof PhpParser\Node\Expr\BinaryOp\BooleanAnd ||
|
||||
$stmt instanceof PhpParser\Node\Expr\BinaryOp\LogicalAnd
|
||||
) {
|
||||
$if_clauses = TypeChecker::getFormula(
|
||||
$stmt->left,
|
||||
$statements_checker->getFQCLN(),
|
||||
@ -782,7 +784,9 @@ class ExpressionChecker
|
||||
$context->vars_possibly_in_scope
|
||||
);
|
||||
}
|
||||
} elseif ($stmt instanceof PhpParser\Node\Expr\BinaryOp\BooleanOr) {
|
||||
} elseif ($stmt instanceof PhpParser\Node\Expr\BinaryOp\BooleanOr ||
|
||||
$stmt instanceof PhpParser\Node\Expr\BinaryOp\LogicalOr
|
||||
) {
|
||||
$if_clauses = TypeChecker::getFormula(
|
||||
$stmt->left,
|
||||
$statements_checker->getFQCLN(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user