mirror of
https://github.com/danog/psalm-plugin-symfony.git
synced 2024-11-30 04:29:10 +01:00
[psalm] detect dead code & unused suppresses (#51)
This commit is contained in:
parent
b9f4745e28
commit
ec7545a086
2
.github/workflows/integrate.yaml
vendored
2
.github/workflows/integrate.yaml
vendored
@ -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"
|
||||
|
@ -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",
|
||||
|
@ -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':
|
||||
|
@ -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)]);
|
||||
}
|
||||
|
@ -13,6 +13,9 @@ use Psalm\SymfonyPsalmPlugin\Handler\HeaderBagHandler;
|
||||
use Psalm\SymfonyPsalmPlugin\Symfony\ContainerMeta;
|
||||
use SimpleXMLElement;
|
||||
|
||||
/**
|
||||
* @psalm-suppress UnusedClass
|
||||
*/
|
||||
class Plugin implements PluginEntryPointInterface
|
||||
{
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user