Skip to content

Commit

Permalink
Merge pull request #9025 from kkmuffme/fix-method-phpdoc-errors-repor…
Browse files Browse the repository at this point in the history
…ted-for-stubs-instead-of-files

fixes return type issues of methods reported for the wrong file
  • Loading branch information
orklah committed Dec 29, 2022
2 parents 5a6e8cb + 9130ee2 commit 2efa6ae
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Psalm/Internal/Codebase/Methods.php
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,12 @@ public function getMethodReturnTypeLocation(

$storage = $this->getStorage($method_id);

// if function exists in stubs and in analyzed code
// use the return type location of the analyzed code instead of the stubbed location
if ($storage->stubbed) {
return null;
}

if (!$storage->return_type_location) {
$overridden_method_ids = $this->getOverriddenMethodIds($method_id);

Expand Down

0 comments on commit 2efa6ae

Please sign in to comment.