From 9f3f420a5b1785d06b9b9170b5b953a6de04685e Mon Sep 17 00:00:00 2001 From: Matt Brown Date: Mon, 22 Mar 2021 09:44:15 -0400 Subject: [PATCH] Turn on unused variable detection by default on level 1 --- src/Psalm/Config.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Psalm/Config.php b/src/Psalm/Config.php index 02e663cc7..62bb9a424 100644 --- a/src/Psalm/Config.php +++ b/src/Psalm/Config.php @@ -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;