Skip to content

Commit

Permalink
Use $codebase->classlike_storage_provider only if it has the required…
Browse files Browse the repository at this point in the history
… data. Fixes #8373
  • Loading branch information
Daeroni committed Aug 5, 2022
1 parent 1ef3851 commit 88fb887
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Psalm/Internal/Type/TemplateStandinTypeReplacer.php
Expand Up @@ -1138,7 +1138,7 @@ public static function getMappedGenericTypeParams(
): 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;
Expand All @@ -1150,6 +1150,8 @@ public static function getMappedGenericTypeParams(
} else {
$input_type_params = array_fill(0, count($class_storage->template_types ?? []), Type::getMixed());
}
} else {
$input_type_params = [];
}

try {
Expand Down

0 comments on commit 88fb887

Please sign in to comment.