Skip to content

Commit

Permalink
Resolve tests with creation of a list of issues
Browse files Browse the repository at this point in the history
Resolved problems:
```
1) Psalm\Tests\MagicMethodAnnotationTest::testInvalidCodeWithIssues with data set "staticInvocationWithMagicMethodFoo"
UnexpectedValueException: Cannot get method params for A::foo

2) Psalm\Tests\MagicMethodAnnotationTest::testInvalidCodeWithIssues with data set "nonStaticSelfCallWithMagicMethodFoo"
UnexpectedValueException: Cannot get method params for B::foo
```
  • Loading branch information
issidorov committed Feb 13, 2024
1 parent 9b6ef8b commit e940de5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Psalm/Internal/Codebase/Methods.php
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ public function getMethodParams(
}
}

$declaring_method_id = $this->getDeclaringMethodId($method_id);
$declaring_method_id = $this->getDeclaringMethodId($method_id, true);

$callmap_id = $declaring_method_id ?? $method_id;

Expand Down Expand Up @@ -424,7 +424,7 @@ public function getMethodParams(
}

if ($declaring_method_id) {
$storage = $this->getStorage($declaring_method_id);
$storage = $this->getStorage($declaring_method_id, true);

$params = $storage->params;

Expand Down Expand Up @@ -1088,7 +1088,7 @@ public function getCasedMethodId(MethodIdentifier $original_method_id): string

public function getUserMethodStorage(MethodIdentifier $method_id): ?MethodStorage
{
$declaring_method_id = $this->getDeclaringMethodId($method_id);
$declaring_method_id = $this->getDeclaringMethodId($method_id, true);

if (!$declaring_method_id) {
if (InternalCallMapHandler::inCallMap((string) $method_id)) {
Expand All @@ -1098,7 +1098,7 @@ public function getUserMethodStorage(MethodIdentifier $method_id): ?MethodStorag
throw new UnexpectedValueException('$storage should not be null for ' . $method_id);
}

$storage = $this->getStorage($declaring_method_id);
$storage = $this->getStorage($declaring_method_id, true);

if (!$storage->location) {
return null;
Expand Down

0 comments on commit e940de5

Please sign in to comment.