1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-02 17:52:45 +01:00

Do not throw access errors when array might be empty

This commit is contained in:
Matthew Brown 2016-09-12 12:23:51 -04:00
parent 6a9bcea901
commit 7298b41c45

View File

@ -3648,7 +3648,7 @@ class StatementsChecker
} }
if ($stmt->dim) { if ($stmt->dim) {
if (isset($stmt->dim->inferredType) && $key_type) { if (isset($stmt->dim->inferredType) && $key_type && !$key_type->isEmpty()) {
foreach ($stmt->dim->inferredType->types as $at) { foreach ($stmt->dim->inferredType->types as $at) {
if ($at->isMixed()) { if ($at->isMixed()) {
// @todo emit issue // @todo emit issue