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

Fix #4297 - use correct property id for each different MissingConstructor error

This commit is contained in:
Matt Brown 2020-10-07 17:54:00 -04:00 committed by Daniil Gentili
parent 49dcec6d4a
commit 5c1fcf403c
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7

View File

@ -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]