Skip to content

Commit

Permalink
Make reportInfo="false" flag better
Browse files Browse the repository at this point in the history
  • Loading branch information
muglug committed Sep 1, 2020
1 parent f6b2d0c commit de6e7f3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Psalm/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -1467,6 +1467,10 @@ public function getReportingLevelForIssue(CodeIssue $e) : string
$reporting_level = $this->getReportingLevelForFile($issue_type, $e->getFilePath());
}

if (!$this->report_info && $reporting_level === self::REPORT_INFO) {
$reporting_level = self::REPORT_SUPPRESS;
}

$parent_issue_type = self::getParentIssueType($issue_type);

if ($parent_issue_type && $reporting_level === Config::REPORT_ERROR) {
Expand Down Expand Up @@ -1610,7 +1614,7 @@ public function getReportingLevelForFile($issue_type, $file_path)
$issue_level = $issue_class::ERROR_LEVEL;

if ($issue_level > 0 && $issue_level < $this->level) {
return $this->report_info ? self::REPORT_INFO : self::REPORT_SUPPRESS;
return self::REPORT_INFO;
}

return self::REPORT_ERROR;
Expand Down

0 comments on commit de6e7f3

Please sign in to comment.