From 2cf131fb45f8b211e4b11e148519ed390a5323a2 Mon Sep 17 00:00:00 2001 From: hirokinoue <70567194+hirokinoue@users.noreply.github.com> Date: Sat, 17 Sep 2022 23:08:29 +0900 Subject: [PATCH] allow StaticPropertyFetch node to behave like Variable node --- .../Internal/Analyzer/Statements/Expression/AssertionFinder.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php b/src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php index eb537d018e2..1cd6ed62f41 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php @@ -3687,6 +3687,7 @@ private static function getArrayKeyExistsAssertions( } } elseif (($expr->getArgs()[0]->value instanceof PhpParser\Node\Expr\Variable || $expr->getArgs()[0]->value instanceof PhpParser\Node\Expr\PropertyFetch + || $expr->getArgs()[0]->value instanceof PhpParser\Node\Expr\StaticPropertyFetch ) && $source instanceof StatementsAnalyzer && ($first_var_type = $source->node_data->getType($expr->getArgs()[0]->value))