src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/StaticPropertyAssignmentAnalyzer.php 1 location
|
@@ 195-206 (lines=12) @@
|
192 |
|
|
193 |
|
$prop_name_name = $prop_name->name; |
194 |
|
|
195 |
|
if ($source_analyzer instanceof ClassAnalyzer |
196 |
|
&& $fq_class_name === $source_analyzer->getFQCLN() |
197 |
|
) { |
198 |
|
if (isset($source_analyzer->inferred_property_types[$prop_name_name])) { |
199 |
|
$source_analyzer->inferred_property_types[$prop_name_name] = Type::combineUnionTypes( |
200 |
|
$assignment_value_type, |
201 |
|
$source_analyzer->inferred_property_types[$prop_name_name] |
202 |
|
); |
203 |
|
} else { |
204 |
|
$source_analyzer->inferred_property_types[$prop_name_name] = $assignment_value_type; |
205 |
|
} |
206 |
|
} |
207 |
|
} else { |
208 |
|
$class_property_type = clone $class_property_type; |
209 |
|
} |
src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php 1 location
|
@@ 779-790 (lines=12) @@
|
776 |
|
|
777 |
|
$source_analyzer = $statements_analyzer->getSource()->getSource(); |
778 |
|
|
779 |
|
if ($lhs_var_id === '$this' |
780 |
|
&& $source_analyzer instanceof ClassAnalyzer |
781 |
|
) { |
782 |
|
if (isset($source_analyzer->inferred_property_types[$prop_name])) { |
783 |
|
$source_analyzer->inferred_property_types[$prop_name] = Type::combineUnionTypes( |
784 |
|
$assignment_value_type, |
785 |
|
$source_analyzer->inferred_property_types[$prop_name] |
786 |
|
); |
787 |
|
} else { |
788 |
|
$source_analyzer->inferred_property_types[$prop_name] = $assignment_value_type; |
789 |
|
} |
790 |
|
} |
791 |
|
} |
792 |
|
|
793 |
|
if (!$class_property_type->isMixed()) { |