diff --git a/src/Psalm/Internal/Analyzer/ClassAnalyzer.php b/src/Psalm/Internal/Analyzer/ClassAnalyzer.php index 180f6c881..137dbd0bf 100644 --- a/src/Psalm/Internal/Analyzer/ClassAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/ClassAnalyzer.php @@ -1457,11 +1457,11 @@ class ClassAnalyzer extends ClassLikeAnalyzer } if (!$storage->abstract && $uninitialized_typed_properties) { - foreach ($uninitialized_typed_properties as $uninitialized_property) { + foreach ($uninitialized_typed_properties as $id => $uninitialized_property) { if ($uninitialized_property->location) { if (IssueBuffer::accepts( new MissingConstructor( - $class_storage->name . ' has an uninitialized property ' . $uninitialized_variables[0] . + $class_storage->name . ' has an uninitialized property ' . $id . ', but no constructor', $uninitialized_property->location, $class_storage->name . '::' . $uninitialized_variables[0]