1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +01:00

Merge pull request #7431 from zoonru/disable_suppress_all

This commit is contained in:
Bruce Weirdan 2022-01-24 11:25:32 +02:00 committed by GitHub
commit 3a6dc9b458
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 1 deletions

View File

@ -114,6 +114,7 @@
<xs:attribute name="reportInfo" type="xs:boolean" default="true" />
<xs:attribute name="restrictReturnTypes" type="xs:boolean" default="false" />
<xs:attribute name="limitMethodComplexity" type="xs:boolean" default="false" />
<xs:attribute name="disableSuppressAll" type="xs:boolean" default="false" />
<xs:attribute name="triggerErrorExits" type="TriggerErrorExitsType" default="default" />
</xs:complexType>

View File

@ -154,6 +154,15 @@ This flag is deprecated and will be removed in Psalm 5
```
When `true`, strings can be used as classes, meaning `$some_string::someMethod()` is allowed. If `false`, only class constant strings (of the form `Foo\Bar::class`) can stand in for classes, otherwise an `InvalidStringClass` issue is emitted. Defaults to `false`.
#### disableSuppressAll
```xml
<psalm
disableSuppressAll="[bool]"
>
```
When `true`, disables wildcard suppression of all issues with `@psalm-suppress all`. Defaults to `false`.
#### memoizeMethodCallResults
```xml

View File

@ -328,6 +328,11 @@ class Config
*/
public $allow_string_standin_for_class = false;
/**
* @var bool
*/
public $disable_suppress_all = false;
/**
* @var bool
*/
@ -912,6 +917,7 @@ class Config
'rememberPropertyAssignmentsAfterCall' => 'remember_property_assignments_after_call',
'allowPhpStormGenerics' => 'allow_phpstorm_generics',
'allowStringToStandInForClass' => 'allow_string_standin_for_class',
'disableSuppressAll' => 'disable_suppress_all',
'usePhpDocMethodsWithoutMagicCall' => 'use_phpdoc_method_without_magic_or_parent',
'usePhpDocPropertiesWithoutMagicCall' => 'use_phpdoc_property_without_magic_or_parent',
'memoizeMethodCallResults' => 'memoize_method_calls',

View File

@ -212,7 +212,9 @@ class IssueBuffer
}
}
$suppress_all_position = array_search('all', $suppressed_issues);
$suppress_all_position = $config->disable_suppress_all
? false
: array_search('all', $suppressed_issues);
if ($suppress_all_position !== false) {
if (is_int($suppress_all_position)) {