1
0
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:
Matthew Brown 2018-10-10 00:54:50 -04:00
parent 3050e9eccb
commit 3b8e82cca1
2 changed files with 17 additions and 0 deletions

View File

@ -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) {

View File

@ -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 {}