Skip to content

Commit

Permalink
Get function analyser once per method
Browse files Browse the repository at this point in the history
  • Loading branch information
muglug committed May 31, 2019
1 parent cd969c5 commit 84c0554
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Psalm/Internal/Codebase/ClassLikes.php
Expand Up @@ -931,6 +931,11 @@ private function checkMethodReferences(ClassLikeStorage $classlike_storage, Meth
&& isset($project_analyzer->getIssuesToFix()['MissingParamType']) && isset($project_analyzer->getIssuesToFix()['MissingParamType'])
) { ) {
if ($method_storage->possible_param_types && $method_storage->location) { if ($method_storage->possible_param_types && $method_storage->location) {
$function_analyzer = $project_analyzer->getFunctionLikeAnalyzer(
$method_id,
$method_storage->location->file_path
);

foreach ($method_storage->possible_param_types as $offset => $possible_type) { foreach ($method_storage->possible_param_types as $offset => $possible_type) {
if (!isset($method_storage->params[$offset])) { if (!isset($method_storage->params[$offset])) {
continue; continue;
Expand All @@ -942,11 +947,6 @@ private function checkMethodReferences(ClassLikeStorage $classlike_storage, Meth
continue; continue;
} }


$function_analyzer = $project_analyzer->getFunctionLikeAnalyzer(
$method_id,
$method_storage->location->file_path
);

$function_analyzer->addOrUpdateParamType( $function_analyzer->addOrUpdateParamType(
$project_analyzer, $project_analyzer,
$param_name, $param_name,
Expand Down

0 comments on commit 84c0554

Please sign in to comment.