From 9071e877a8d240bdf3ac7b32ba4f3549d5f83f52 Mon Sep 17 00:00:00 2001 From: hirokinoue <70567194+hirokinoue@users.noreply.github.com> Date: Sun, 18 Sep 2022 01:15:09 +0900 Subject: [PATCH] fix according to psalm analysis --- .../Analyzer/Statements/Expression/AssertionFinder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php b/src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php index 1cd6ed62f41..029d9422cf9 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php @@ -3653,8 +3653,8 @@ private static function getArrayKeyExistsAssertions( ) : null; - if ($array_root) { - if ($first_var_name === null && isset($expr->getArgs()[0])) { + if ($array_root && isset($expr->getArgs()[0])) { + if ($first_var_name === null) { $first_arg = $expr->getArgs()[0]; if ($first_arg->value instanceof PhpParser\Node\Scalar\String_) {