Skip to content
Permalink
Browse files

Speed up missing property type consolidation

  • Loading branch information
muglug committed Dec 3, 2019
1 parent 9f69d9a commit dd05f6e3ca305d9fa61d650cde8e06dd908ef7e8
Showing with 13 additions and 11 deletions.
  1. +13 −11 src/Psalm/Internal/Codebase/ClassLikes.php
@@ -1922,15 +1922,10 @@ private function findPossibleMethodParamTypes(ClassLikeStorage $classlike_storag
if (isset($codebase->analyzer->possible_method_param_types[strtolower($method_id)])) {
if ($method_storage->location) {
$function_analyzer = $project_analyzer->getFunctionLikeAnalyzer(
$method_id,
$method_storage->location->file_path
);
$possible_param_types
= $codebase->analyzer->possible_method_param_types[strtolower($method_id)];
if ($function_analyzer && $possible_param_types) {
if ($possible_param_types) {
foreach ($possible_param_types as $offset => $possible_type) {
if (!isset($method_storage->params[$offset])) {
continue;
@@ -1952,12 +1947,19 @@ private function findPossibleMethodParamTypes(ClassLikeStorage $classlike_storag
if ($codebase->alter_code
&& isset($project_analyzer->getIssuesToFix()['MissingParamType'])
) {
$function_analyzer->addOrUpdateParamType(
$project_analyzer,
$param_name,
$possible_type,
true
$function_analyzer = $project_analyzer->getFunctionLikeAnalyzer(
$method_id,
$method_storage->location->file_path
);
if ($function_analyzer) {
$function_analyzer->addOrUpdateParamType(
$project_analyzer,
$param_name,
$possible_type,
true
);
}
} else {
IssueBuffer::addFixableIssue('MissingParamType');
}

0 comments on commit dd05f6e

Please sign in to comment.
You can’t perform that action at this time.