Skip to content

Commit

Permalink
shepherd
Browse files Browse the repository at this point in the history
  • Loading branch information
kkmuffme committed Mar 13, 2024
1 parent 248defb commit eb969cd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Psalm/Internal/Analyzer/ClassAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -872,9 +872,10 @@ public static function addContextProperties(
if (!$property_type->isMixed()
&& (!$property_storage->is_promoted
|| (strtolower($fq_class_name) !== strtolower($property_class_name)
&& strtolower(
$storage->declaring_method_ids['__construct']->fq_class_name,
) === strtolower($fq_class_name)))
&& isset($storage->declaring_method_ids['__construct'])
&& strtolower(
$storage->declaring_method_ids['__construct']->fq_class_name,
) === strtolower($fq_class_name)))
&& !$property_storage->has_default
&& !($property_type->isNullable() && $property_type->from_docblock)
) {
Expand All @@ -888,6 +889,7 @@ public static function addContextProperties(
if (!$property_storage->has_default
&& (!$property_storage->is_promoted
|| (strtolower($fq_class_name) !== strtolower($property_class_name)
&& isset($storage->declaring_method_ids['__construct'])
&& strtolower(
$storage->declaring_method_ids['__construct']->fq_class_name,
) === strtolower($fq_class_name)))) {
Expand Down Expand Up @@ -1108,6 +1110,7 @@ private function checkPropertyInitialization(

if ($property->is_promoted
&& strtolower($property_class_name) !== $fq_class_name_lc
&& isset($storage->declaring_method_ids['__construct'])
&& strtolower($storage->declaring_method_ids['__construct']->fq_class_name) === $fq_class_name_lc) {
$property_is_initialized = false;
}
Expand Down

0 comments on commit eb969cd

Please sign in to comment.