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

allow PropertyFetch node to behave like Variable node

This commit is contained in:
hirokinoue 2022-09-17 22:36:16 +09:00
parent a2118c65d3
commit faf4e8ef84

View File

@ -3685,7 +3685,9 @@ class AssertionFinder
} else {
$first_var_name = null;
}
} elseif ($expr->getArgs()[0]->value instanceof PhpParser\Node\Expr\Variable
} elseif (($expr->getArgs()[0]->value instanceof PhpParser\Node\Expr\Variable
|| $expr->getArgs()[0]->value instanceof PhpParser\Node\Expr\PropertyFetch
)
&& $source instanceof StatementsAnalyzer
&& ($first_var_type = $source->node_data->getType($expr->getArgs()[0]->value))
) {