mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 22:01:48 +01:00
Fix #4206 - add shortcut for if ((bool) $foo)
This commit is contained in:
parent
ec64ae930a
commit
5302936e76
@ -345,6 +345,19 @@ class Algebra
|
||||
}
|
||||
}
|
||||
|
||||
if ($conditional instanceof PhpParser\Node\Expr\Cast\Bool_) {
|
||||
return self::getFormula(
|
||||
$conditional_object_id,
|
||||
\spl_object_id($conditional->expr),
|
||||
$conditional->expr,
|
||||
$this_class_name,
|
||||
$source,
|
||||
$codebase,
|
||||
$inside_negation,
|
||||
$cache
|
||||
);
|
||||
}
|
||||
|
||||
$assertions = null;
|
||||
|
||||
if ($cache && $source instanceof \Psalm\Internal\Analyzer\StatementsAnalyzer) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user