1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

Prevent erroneous unused suppressions from plugin

This commit is contained in:
Matthew Brown 2019-08-18 17:18:03 -04:00
parent 6ea68e9f7f
commit 43a9ff0735
2 changed files with 1 additions and 2 deletions

View File

@ -152,7 +152,7 @@ abstract class FunctionLikeAnalyzer extends SourceAnalyzer implements Statements
$classlike_storage_provider = $codebase->classlike_storage_provider;
if ($codebase->track_unused_suppressions) {
if ($codebase->track_unused_suppressions && !isset($storage->suppressed_issues[0])) {
foreach ($storage->suppressed_issues as $offset => $issue_name) {
IssueBuffer::addUnusedSuppression($this->getFilePath(), $offset, $issue_name);
}

View File

@ -309,7 +309,6 @@ class PartialParserVisitor extends PhpParser\NodeVisitorAbstract implements PhpP
}
if ($end_offset !== 0) {
/** @psalm-suppress MixedOperand */
$node->setAttribute('endFilePos', $stmt_end_pos + $end_offset);
}