Skip to content

Fix generic object comparison to use template constraint as default.#8069

Merged
orklah merged 2 commits intovimeo:4.xfrom
AndrolGenhald:bugfix/8068
Jun 8, 2022
Merged

Fix generic object comparison to use template constraint as default.#8069
orklah merged 2 commits intovimeo:4.xfrom
AndrolGenhald:bugfix/8068

Conversation

@AndrolGenhald
Copy link
Copy Markdown
Collaborator

Fixes #8068.

@AndrolGenhald AndrolGenhald added the release:fix The PR will be included in 'Fixes' section of the release notes label Jun 8, 2022
Comment on lines +1142 to +1152
$class_storage = $codebase->classlike_storage_provider->get($input_type_part->value);

$container_class = $container_type_part->value;

if (strtolower($input_type_part->value) === strtolower($container_type_part->value)) {
$input_type_params = $class_storage->getClassTemplateTypes();
} elseif (!empty($class_storage->template_extended_params[$container_class])) {
$input_type_params = array_values($class_storage->template_extended_params[$container_class]);
} else {
$input_type_params = array_fill(0, count($class_storage->template_types ?? []), Type::getMixed());
}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will conflict with #8044 when both are merged to master, this one is correct.

@orklah orklah merged commit b113d77 into vimeo:4.x Jun 8, 2022
@orklah
Copy link
Copy Markdown
Collaborator

orklah commented Jun 8, 2022

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:fix The PR will be included in 'Fixes' section of the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

class-string false positive for constrained template

2 participants