1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Use $codebase->classlike_storage_provider only if it has the required data. Fixes #8373

This commit is contained in:
Teemu Koskinen 2022-08-06 02:27:01 +03:00
parent 57fcc3968e
commit fefd4861d6
No known key found for this signature in database
GPG Key ID: C342F807E9022ADD

View File

@ -1138,7 +1138,7 @@ class TemplateStandinTypeReplacer
): array {
if ($input_type_part instanceof TGenericObject || $input_type_part instanceof TIterable) {
$input_type_params = $input_type_part->type_params;
} else {
} elseif ($codebase->classlike_storage_provider->has($input_type_part->value)) {
$class_storage = $codebase->classlike_storage_provider->get($input_type_part->value);
$container_class = $container_type_part->value;
@ -1150,6 +1150,8 @@ class TemplateStandinTypeReplacer
} else {
$input_type_params = array_fill(0, count($class_storage->template_types ?? []), Type::getMixed());
}
} else {
$input_type_params = [];
}
try {