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

Turn on unused variable detection by default on level 1

This commit is contained in:
Matt Brown 2021-03-22 09:44:15 -04:00
parent fb94db9b1f
commit 9f3f420a5b

View File

@ -849,6 +849,15 @@ class Config
$config->level = 2;
}
// turn on unused variable detection in level 1
if (!isset($config_xml['findUnusedCode'])
&& !isset($config_xml['findUnusedVariablesAndParams'])
&& $config->level === 1
&& $config->show_mixed_issues !== false
) {
$config->find_unused_variables = true;
}
if (isset($config_xml['errorBaseline'])) {
$attribute_text = (string) $config_xml['errorBaseline'];
$config->error_baseline = $attribute_text;