1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Only allow string offset assignment when offset is integer

This commit is contained in:
Matthew Brown 2019-11-05 19:05:43 -05:00
parent cbaf050bd2
commit 050045209f

View File

@ -329,7 +329,7 @@ class ArrayAssignmentAnalyzer
}
}
if ($type instanceof Type\Atomic\TString) {
if ($type instanceof Type\Atomic\TString && is_int($key_value)) {
$has_matching_string = true;
if ($type instanceof Type\Atomic\TLiteralString