mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
Limit removal of vars further
This commit is contained in:
parent
ad0b575080
commit
ecfc4726d7
@ -249,6 +249,7 @@ class ElseIfAnalyzer
|
||||
foreach ($elseif_context->vars_in_scope as $var_id => $_) {
|
||||
if (preg_match('/' . preg_quote($changed_var_id, '/') . '[\]\[\-]/', $var_id)
|
||||
&& !\array_key_exists($var_id, $newly_reconciled_var_ids)
|
||||
&& !\array_key_exists($var_id, $cond_referenced_var_ids)
|
||||
) {
|
||||
unset($elseif_context->vars_in_scope[$var_id]);
|
||||
}
|
||||
|
@ -294,6 +294,7 @@ class IfElseAnalyzer
|
||||
foreach ($if_context->vars_in_scope as $var_id => $_) {
|
||||
if (preg_match('/' . preg_quote($changed_var_id, '/') . '[\]\[\-]/', $var_id)
|
||||
&& !\array_key_exists($var_id, $changed_var_ids)
|
||||
&& !\array_key_exists($var_id, $cond_referenced_var_ids)
|
||||
) {
|
||||
unset($if_context->vars_in_scope[$var_id]);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user