mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
Fix hydration of property types in property map
This commit is contained in:
parent
3050e9eccb
commit
3b8e82cca1
@ -228,6 +228,17 @@ class Scanner
|
||||
}
|
||||
|
||||
$this->store_scan_failure[$fq_classlike_name] = $store_failure;
|
||||
|
||||
if (PropertyMap::inPropertyMap($fq_classlike_name_lc)) {
|
||||
$public_mapped_properties = PropertyMap::getPropertyMap()[$fq_classlike_name_lc];
|
||||
|
||||
foreach ($public_mapped_properties as $property_name => $public_mapped_property) {
|
||||
if (strtolower($public_mapped_property) !== $fq_classlike_name_lc) {
|
||||
$property_type = \Psalm\Type::parseString($public_mapped_property);
|
||||
$property_type->queueClassLikesForScanning($this->codebase);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($referencing_file_path) {
|
||||
|
@ -318,6 +318,12 @@ class PropertyTypeTest extends TestCase
|
||||
'$owner' => 'DOMDocument',
|
||||
],
|
||||
],
|
||||
'propertyMapHydration' => [
|
||||
'<?php
|
||||
function foo(DOMElement $e) : void {
|
||||
echo $e->attributes->length;
|
||||
}',
|
||||
],
|
||||
'goodArrayProperties' => [
|
||||
'<?php
|
||||
interface I1 {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user