diff --git a/UPGRADING.md b/UPGRADING.md index 01f1a67ddda..57416dc5aa0 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -9,6 +9,8 @@ - [BC] The `TDependentListKey` type was removed and replaced with an optional property of the `TIntRange` type. +- [BC] Configuration: `findUnusedCode`'s default value changed from `false` to `true`. + # Upgrading from Psalm 4 to Psalm 5 ## Changed diff --git a/config.xsd b/config.xsd index c36262ad15a..bc9d3aab95f 100644 --- a/config.xsd +++ b/config.xsd @@ -41,6 +41,7 @@ + diff --git a/src/Psalm/Config.php b/src/Psalm/Config.php index 096d6d32cce..c10a6124713 100644 --- a/src/Psalm/Config.php +++ b/src/Psalm/Config.php @@ -60,7 +60,6 @@ use function class_exists; use function clearstatcache; use function count; -use function defined; use function dirname; use function explode; use function extension_loaded; @@ -70,7 +69,6 @@ use function filetype; use function flock; use function fopen; -use function fwrite; use function get_class; use function get_defined_constants; use function get_defined_functions; @@ -124,7 +122,6 @@ use const PHP_VERSION_ID; use const PSALM_VERSION; use const SCANDIR_SORT_NONE; -use const STDERR; /** * @psalm-suppress PropertyNotSetInConstructor @@ -444,7 +441,7 @@ class Config public $forbidden_functions = []; /** - * TODO: Psalm 6: Update default to be true and remove warning. + * TODO: Psalm 6: Update default to be true * * @var bool */ @@ -1090,14 +1087,10 @@ private static function fromXmlAndPaths( $config->use_igbinary = version_compare($igbinary_version, '2.0.5') >= 0; } - if (isset($config_xml['findUnusedCode'])) { $attribute_text = (string) $config_xml['findUnusedCode']; $config->find_unused_code = $attribute_text === 'true' || $attribute_text === '1'; $config->find_unused_variables = $config->find_unused_code; - } elseif (!defined('__IS_TEST_ENV__')) { - fwrite(STDERR, 'Warning: "findUnusedCode" will be defaulted to "true" in Psalm 6. You should explicitly' - . ' enable or disable this setting.' . PHP_EOL); } if (isset($config_xml['findUnusedVariablesAndParams'])) {