1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00
This commit is contained in:
Brown 2020-04-12 21:47:50 -04:00
parent 73f8f963fa
commit 633b210a32

View File

@ -1101,7 +1101,12 @@ class ExpressionAnalyzer
$offset = 'static::' . $stmt->dim->name; $offset = 'static::' . $stmt->dim->name;
} elseif ($stmt->dim } elseif ($stmt->dim
&& $source instanceof StatementsAnalyzer && $source instanceof StatementsAnalyzer
&& ($stmt_dim_type = $source->node_data->getType($stmt->dim))) { && ($stmt_dim_type = $source->node_data->getType($stmt->dim))
&& (!$stmt->dim instanceof PhpParser\Node\Expr\ClassConstFetch
|| !$stmt->dim->name instanceof PhpParser\Node\Identifier
|| $stmt->dim->name->name !== 'class'
)
) {
if ($stmt_dim_type->isSingleStringLiteral()) { if ($stmt_dim_type->isSingleStringLiteral()) {
$offset = '\'' . $stmt_dim_type->getSingleStringLiteral()->value . '\''; $offset = '\'' . $stmt_dim_type->getSingleStringLiteral()->value . '\'';
} elseif ($stmt_dim_type->isSingleIntLiteral()) { } elseif ($stmt_dim_type->isSingleIntLiteral()) {