1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-04 10:38:49 +01:00

qa: ensure we use multiple isset to verify the existence of $arg_var_id

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
This commit is contained in:
Maximilian Bösing 2022-06-12 01:29:30 +02:00
parent c68b6e9d26
commit 6c1ed90dc1
No known key found for this signature in database
GPG Key ID: 9A8988C93CEC81A3

View File

@ -793,10 +793,10 @@ class CallAnalyzer
);
}
}
} else if (isset($arg_var_id, $context->vars_in_scope[$arg_var_id])) {
} elseif (isset($arg_var_id) && isset($context->vars_in_scope[$arg_var_id])) {
$other_type = $context->vars_in_scope[$arg_var_id];
if (self::isNewTypeNarrowingDownOldType($other_type, $union)) {
foreach($union->getAtomicTypes() as $atomic_type) {
foreach ($union->getAtomicTypes() as $atomic_type) {
if ($assertion_type instanceof TTemplateParam
&& $assertion_type->as->getId() === $atomic_type->getId()
) {