[psalm] detect dead code & unused suppresses (#51)

This commit is contained in:
Farhad Safarov 2020-06-27 22:35:28 +03:00 committed by GitHub
parent b9f4745e28
commit ec7545a086
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 5 deletions

View File

@ -55,7 +55,7 @@ jobs:
restore-keys: php-${{ matrix.php-version }}-psalm-
- name: "Run vimeo/psalm"
run: vendor/bin/psalm --config=psalm.xml --diff --diff-methods --shepherd --show-info=false --stats --output-format=github
run: vendor/bin/psalm --find-dead-code --find-unused-psalm-suppress --diff --diff-methods --shepherd --show-info=false --stats --output-format=github
tests:
name: "Tests"

View File

@ -50,7 +50,7 @@
"@phpunit",
"@codeception"
],
"analyze": "psalm",
"analyze": "psalm --find-dead-code --find-unused-psalm-suppress --long-progress",
"phpunit": "phpunit --testdox",
"codeception": [
"codecept build",

View File

@ -51,7 +51,6 @@ class ConsoleHandler implements AfterMethodCallAnalysisInterface
) {
switch ($declaring_method_id) {
case 'Symfony\Component\Console\Command\Command::addargument':
/** @psalm-suppress PossiblyInvalidArgument */
self::analyseArgument($expr->args, $statements_source);
break;
case 'Symfony\Component\Console\Input\InputInterface::getargument':
@ -65,7 +64,6 @@ class ConsoleHandler implements AfterMethodCallAnalysisInterface
}
break;
case 'Symfony\Component\Console\Command\Command::addoption':
/** @psalm-suppress PossiblyInvalidArgument */
self::analyseOption($expr->args, $statements_source);
break;
case 'Symfony\Component\Console\Input\InputInterface::getoption':

View File

@ -90,7 +90,6 @@ class ContainerHandler implements AfterMethodCallAnalysisInterface, AfterClassLi
if ($service->isPublic()) {
$class = $service->getClassName();
if ($class) {
/** @psalm-suppress InternalMethod */
$codebase->classlikes->addFullyQualifiedClassName($class);
$return_type_candidate = new Union([new TNamedObject($class)]);
}

View File

@ -13,6 +13,9 @@ use Psalm\SymfonyPsalmPlugin\Handler\HeaderBagHandler;
use Psalm\SymfonyPsalmPlugin\Symfony\ContainerMeta;
use SimpleXMLElement;
/**
* @psalm-suppress UnusedClass
*/
class Plugin implements PluginEntryPointInterface
{
/**