mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 04:45:20 +01:00
Allow int offsets to be treated as keys
This commit is contained in:
parent
12b5097fba
commit
c3df70e634
@ -919,7 +919,8 @@ class ExpressionChecker
|
||||
array $aliased_classes
|
||||
) {
|
||||
if ($stmt instanceof PhpParser\Node\Expr\ArrayDimFetch &&
|
||||
$stmt->dim instanceof PhpParser\Node\Scalar\String_
|
||||
($stmt->dim instanceof PhpParser\Node\Scalar\String_ ||
|
||||
$stmt->dim instanceof PhpParser\Node\Scalar\LNumber)
|
||||
) {
|
||||
$root_var_id = self::getArrayVarId($stmt->var, $this_class_name, $namespace, $aliased_classes);
|
||||
return $root_var_id ? $root_var_id . '[\'' . $stmt->dim->value . '\']' : null;
|
||||
|
Loading…
Reference in New Issue
Block a user