Skip to content
Permalink
Browse files

Add a warning when fixing unused code issues without accompanying det…

…ection
  • Loading branch information...
muglug committed Apr 30, 2019
1 parent d53ba0b commit 56741939220963f30c8bb13113b2d035fb5d8d03
Showing with 11 additions and 0 deletions.
  1. +11 −0 src/psalter.php
@@ -325,6 +325,17 @@ function (string $line) : bool {
if ($find_unused_code) {
$project_analyzer->getCodebase()->reportUnusedCode();
} else {
foreach ($keyed_issues as $issue_name => $_) {
if (strpos($issue_name, 'Unused') !== false) {
die(
'Error: Psalm can only fix issue '
. $issue_name
. ' if you enable unused code detection with --find-unused-code'
. PHP_EOL
);
}
}
}
$project_analyzer->alterCodeAfterCompletion(

0 comments on commit 5674193

Please sign in to comment.
You can’t perform that action at this time.