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:
parent
6a9bcea901
commit
7298b41c45
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user