Skip to content

Commit

Permalink
Use correct file path while adding unused suppressions for virtual __…
Browse files Browse the repository at this point in the history
…constructs
  • Loading branch information
danog committed Dec 1, 2023
1 parent f9f8bac commit eabb57f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public function analyze(
|| !in_array("UnusedPsalmSuppress", $storage->suppressed_issues)
) {
foreach ($storage->suppressed_issues as $offset => $issue_name) {
IssueBuffer::addUnusedSuppression($this->getFilePath(), $offset, $issue_name);
IssueBuffer::addUnusedSuppression($storage->location->file_path, $offset, $issue_name);

Check failure on line 189 in src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php

View workflow job for this annotation

GitHub Actions / build

PossiblyNullPropertyFetch

src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php:189:55: PossiblyNullPropertyFetch: Cannot get property on possibly null variable $storage->location of type Psalm\CodeLocation|null (see https://psalm.dev/082)

Check failure on line 189 in src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php

View workflow job for this annotation

GitHub Actions / build

PossiblyNullArgument

src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php:189:55: PossiblyNullArgument: Argument 1 of Psalm\IssueBuffer::addUnusedSuppression cannot be null, possibly null value provided (see https://psalm.dev/078)
}
}
}
Expand Down

0 comments on commit eabb57f

Please sign in to comment.