1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-04 18:48:03 +01:00

Use ArrayCreationInfo for class strings

This commit is contained in:
Bruce Weirdan 2021-08-11 00:29:14 +03:00
parent 47d3d31c47
commit ba4f1db2cd
No known key found for this signature in database
GPG Key ID: CFC3AAB181751B0D

View File

@ -430,8 +430,6 @@ class SimpleTypeInferer
return Type::getEmptyArray();
}
$class_strings = [];
$can_create_objectlike = true;
$is_list = true;
@ -519,7 +517,7 @@ class SimpleTypeInferer
|| $atomic_type instanceof Type\Atomic\TLiteralString
) {
if ($atomic_type instanceof Type\Atomic\TLiteralClassString) {
$class_strings[$atomic_type->value] = true;
$array_creation_info->class_strings[$atomic_type->value] = true;
}
$array_creation_info->property_types[$atomic_type->value] = $single_item_value_type;
@ -566,7 +564,7 @@ class SimpleTypeInferer
) {
$objectlike = new Type\Atomic\TKeyedArray(
$array_creation_info->property_types,
$class_strings
$array_creation_info->class_strings
);
$objectlike->sealed = true;
$objectlike->is_list = $is_list;