From 933714f6ad1d7adc5df9c41d431e930cf637516d Mon Sep 17 00:00:00 2001 From: Benjamin Morel Date: Thu, 23 Jun 2022 10:36:26 +0200 Subject: [PATCH] Add ReflectionProperty properties --- dictionaries/PropertyMap.php | 4 ++++ src/Psalm/Internal/Codebase/Reflection.php | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dictionaries/PropertyMap.php b/dictionaries/PropertyMap.php index 8c874598b..f769b171c 100644 --- a/dictionaries/PropertyMap.php +++ b/dictionaries/PropertyMap.php @@ -450,6 +450,10 @@ return [ 'reflectionparameter' => [ 'name' => 'string', ], + 'reflectionproperty' => [ + 'name' => 'string', + 'class' => 'string', + ], 'phpparser\\node\\expr\\array_' => [ 'items' => 'array', ], diff --git a/src/Psalm/Internal/Codebase/Reflection.php b/src/Psalm/Internal/Codebase/Reflection.php index ed3b3fc1b..8a50103b2 100644 --- a/src/Psalm/Internal/Codebase/Reflection.php +++ b/src/Psalm/Internal/Codebase/Reflection.php @@ -133,9 +133,9 @@ class Reflection $storage->properties[$property_name]->visibility = ClassLikeAnalyzer::VISIBILITY_PRIVATE; } - $property_id = (string)$class_property->class . '::$' . $property_name; + $property_id = $class_property->class . '::$' . $property_name; - $storage->declaring_property_ids[$property_name] = (string)$class_property->class; + $storage->declaring_property_ids[$property_name] = $class_property->class; $storage->appearing_property_ids[$property_name] = $property_id; if (!$class_property->isPrivate()) {