mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Clean up more unused @psalm-suppress annotations
This commit is contained in:
parent
c5f62d261d
commit
6ea68e9f7f
@ -75,17 +75,8 @@ class FileFilter
|
|||||||
*/
|
*/
|
||||||
protected $declare_strict_types = [];
|
protected $declare_strict_types = [];
|
||||||
|
|
||||||
/**
|
public function __construct(bool $inclusive)
|
||||||
* @param bool $inclusive
|
|
||||||
*
|
|
||||||
* @psalm-suppress DocblockTypeContradiction
|
|
||||||
*/
|
|
||||||
public function __construct($inclusive)
|
|
||||||
{
|
{
|
||||||
if (!is_bool($inclusive)) {
|
|
||||||
throw new \InvalidArgumentException('Filter arg must be bool');
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->inclusive = $inclusive;
|
$this->inclusive = $inclusive;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -539,10 +539,6 @@ class Analyzer
|
|||||||
$codebase->file_reference_provider->addIssue($issue_data['file_path'], $issue_data);
|
$codebase->file_reference_provider->addIssue($issue_data['file_path'], $issue_data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codebase->track_unused_suppressions) {
|
|
||||||
IssueBuffer::processUnusedSuppressions($codebase->file_provider);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -34,7 +34,6 @@ class NamespaceStatementsDiffer extends AstDiffer
|
|||||||
/**
|
/**
|
||||||
* @param string $a_code
|
* @param string $a_code
|
||||||
* @param string $b_code
|
* @param string $b_code
|
||||||
* @psalm-suppress UnusedParam
|
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
|
@ -34,8 +34,6 @@ class PsalmRestarter extends \Composer\XdebugHandler\XdebugHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @psalm-suppress UnusedMethod
|
|
||||||
*
|
|
||||||
* @param mixed $loaded
|
* @param mixed $loaded
|
||||||
*/
|
*/
|
||||||
protected function requiresRestart($loaded)
|
protected function requiresRestart($loaded)
|
||||||
@ -56,8 +54,6 @@ class PsalmRestarter extends \Composer\XdebugHandler\XdebugHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @psalm-suppress UnusedMethod
|
|
||||||
*
|
|
||||||
* @param mixed $command
|
* @param mixed $command
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
@ -122,7 +122,6 @@ trait EmitterTrait
|
|||||||
// The list is not sorted
|
// The list is not sorted
|
||||||
if (!$this->listeners[$eventName][0]) {
|
if (!$this->listeners[$eventName][0]) {
|
||||||
// Sorting
|
// Sorting
|
||||||
/** @psalm-suppress MixedArgument */
|
|
||||||
\array_multisort($this->listeners[$eventName][1], SORT_NUMERIC, $this->listeners[$eventName][2]);
|
\array_multisort($this->listeners[$eventName][1], SORT_NUMERIC, $this->listeners[$eventName][2]);
|
||||||
|
|
||||||
// Marking the listeners as sorted
|
// Marking the listeners as sorted
|
||||||
|
@ -30,7 +30,6 @@ class ShowCommand extends Command
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return void
|
* @return void
|
||||||
* @psalm-suppress UnusedMethod
|
|
||||||
*/
|
*/
|
||||||
protected function configure()
|
protected function configure()
|
||||||
{
|
{
|
||||||
@ -42,7 +41,6 @@ class ShowCommand extends Command
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return null|int
|
* @return null|int
|
||||||
* @psalm-suppress UnusedMethod
|
|
||||||
*/
|
*/
|
||||||
protected function execute(InputInterface $i, OutputInterface $o)
|
protected function execute(InputInterface $i, OutputInterface $o)
|
||||||
{
|
{
|
||||||
|
@ -175,7 +175,6 @@ class SimpleNameResolver extends NodeVisitorAbstract
|
|||||||
* @param PhpParser\Node|string|null $node
|
* @param PhpParser\Node|string|null $node
|
||||||
*
|
*
|
||||||
* @return null|PhpParser\Node\Identifier|PhpParser\Node\Name|PhpParser\Node\NullableType
|
* @return null|PhpParser\Node\Identifier|PhpParser\Node\Name|PhpParser\Node\NullableType
|
||||||
* @psalm-suppress MoreSpecificReturnType
|
|
||||||
* @psalm-suppress InvalidReturnType
|
* @psalm-suppress InvalidReturnType
|
||||||
* @psalm-suppress InvalidReturnStatement
|
* @psalm-suppress InvalidReturnStatement
|
||||||
*/
|
*/
|
||||||
|
@ -142,7 +142,6 @@ class PsalmPluginTest extends TestCase
|
|||||||
* @return void
|
* @return void
|
||||||
* @dataProvider commands
|
* @dataProvider commands
|
||||||
* @test
|
* @test
|
||||||
* @psalm-suppress RedundantConditionGivenDocblockType
|
|
||||||
*/
|
*/
|
||||||
public function showsHelpForCommand(string $command)
|
public function showsHelpForCommand(string $command)
|
||||||
{
|
{
|
||||||
|
@ -105,9 +105,7 @@ class TestCase extends BaseTestCase
|
|||||||
$this->project_analyzer->interpretRefactors();
|
$this->project_analyzer->interpretRefactors();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($track_unused_suppressions) {
|
$this->project_analyzer->trackUnusedSuppressions();
|
||||||
$this->project_analyzer->trackUnusedSuppressions();
|
|
||||||
}
|
|
||||||
|
|
||||||
$file_analyzer = new FileAnalyzer(
|
$file_analyzer = new FileAnalyzer(
|
||||||
$this->project_analyzer,
|
$this->project_analyzer,
|
||||||
|
@ -64,6 +64,8 @@ class UnusedCodeTest extends TestCase
|
|||||||
$this->analyzeFile($file_path, $context, false);
|
$this->analyzeFile($file_path, $context, false);
|
||||||
|
|
||||||
$this->project_analyzer->checkClassReferences();
|
$this->project_analyzer->checkClassReferences();
|
||||||
|
|
||||||
|
\Psalm\IssueBuffer::processUnusedSuppressions($this->project_analyzer->getCodebase()->file_provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -98,9 +100,11 @@ class UnusedCodeTest extends TestCase
|
|||||||
$context = new Context();
|
$context = new Context();
|
||||||
$context->collect_references = true;
|
$context->collect_references = true;
|
||||||
|
|
||||||
$this->analyzeFile($file_path, $context);
|
$this->analyzeFile($file_path, $context, false);
|
||||||
|
|
||||||
$this->project_analyzer->checkClassReferences();
|
$this->project_analyzer->checkClassReferences();
|
||||||
|
|
||||||
|
\Psalm\IssueBuffer::processUnusedSuppressions($this->project_analyzer->getCodebase()->file_provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -499,6 +503,17 @@ class UnusedCodeTest extends TestCase
|
|||||||
return $foo;
|
return $foo;
|
||||||
}',
|
}',
|
||||||
],
|
],
|
||||||
|
'suppressUnusedMethod' => [
|
||||||
|
'<?php
|
||||||
|
class A {
|
||||||
|
/**
|
||||||
|
* @psalm-suppress UnusedMethod
|
||||||
|
*/
|
||||||
|
public function foo() : void {}
|
||||||
|
}
|
||||||
|
|
||||||
|
new A();'
|
||||||
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user