1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Add suppressMixedIssues config flag to hide mixed issues

This commit is contained in:
Brown 2020-02-18 17:23:48 -05:00
parent 87d8947ff3
commit 520b646ef6
2 changed files with 11 additions and 0 deletions

View File

@ -62,6 +62,7 @@
<xs:attribute name="throwExceptionOnError" type="xs:boolean" default="false" />
<xs:attribute name="totallyTyped" type="xs:boolean" default="false" />
<xs:attribute name="errorLevel" type="xs:integer" default="1" />
<xs:attribute name="suppressMixedIssues" type="xs:boolean" default="false" />
<xs:attribute name="useAssertForType" type="xs:boolean" default="true" />
<xs:attribute name="useDocblockTypes" type="xs:boolean" default="true" />
<xs:attribute name="useDocblockPropertyTypes" type="xs:boolean" default="false" />

View File

@ -245,6 +245,11 @@ class Config
/** @var 1|2|3|4|5|6|7|8 */
public $level = 1;
/**
* @var bool
*/
public $suppress_mixed_issues = false;
/** @var bool */
public $strict_binary_operands = false;
@ -759,6 +764,7 @@ class Config
'loadXdebugStub' => 'load_xdebug_stub',
'ensureArrayStringOffsetsExist' => 'ensure_array_string_offsets_exist',
'ensureArrayIntOffsetsExist' => 'ensure_array_int_offsets_exist',
'suppressMixedIssues' => 'suppress_mixed_issues',
];
foreach ($booleanAttributes as $xmlName => $internalName) {
@ -1254,6 +1260,10 @@ class Config
*/
public function reportIssueInFile($issue_type, $file_path)
{
if ($this->suppress_mixed_issues && in_array($issue_type, self::MIXED_ISSUES, true)) {
return false;
}
if ($this->mustBeIgnored($file_path)) {
return false;
}