1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 20:34:47 +01:00

Only run unused code analysis where necessary

This commit is contained in:
Matt Brown 2020-11-21 18:25:18 -05:00 committed by Daniil Gentili
parent d43bb3923b
commit 48fba8a6b9
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7

View File

@ -81,7 +81,9 @@ abstract class FileManipulationTest extends \Psalm\Tests\TestCase
);
$this->project_analyzer->getCodebase()->allow_backwards_incompatible_changes = $allow_backwards_incompatible_changes;
$this->project_analyzer->getCodebase()->reportUnusedCode();
if (strpos(static::class, 'Unused') || strpos(static::class, 'Unnecessary')) {
$this->project_analyzer->getCodebase()->reportUnusedCode();
}
$this->analyzeFile($file_path, $context);