Skip to content
Permalink
Browse files

Clean up more unused @psalm-suppress annotations

  • Loading branch information...
muglug committed Aug 18, 2019
1 parent c5f62d2 commit 6ea68e9f7f021f73e291dd4b34a04ac235c32f55
@@ -75,17 +75,8 @@ class FileFilter
*/
protected $declare_strict_types = [];
/**
* @param bool $inclusive
*
* @psalm-suppress DocblockTypeContradiction
*/
public function __construct($inclusive)
public function __construct(bool $inclusive)
{
if (!is_bool($inclusive)) {
throw new \InvalidArgumentException('Filter arg must be bool');
}
$this->inclusive = $inclusive;
}
@@ -539,10 +539,6 @@ function () use ($rerun) {
$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 @@ public static function diff($name, array $a, array $b, $a_code, $b_code)
/**
* @param string $a_code
* @param string $b_code
* @psalm-suppress UnusedParam
*
* @return bool
*/
@@ -34,8 +34,6 @@ public function disableExtension($disabledExtension)
}
/**
* @psalm-suppress UnusedMethod
*
* @param mixed $loaded
*/
protected function requiresRestart($loaded)
@@ -56,8 +54,6 @@ function ($extension) {
}
/**
* @psalm-suppress UnusedMethod
*
* @param mixed $command
*
* @return void
@@ -122,7 +122,6 @@ public function listeners(string $eventName) : array
// The list is not sorted
if (!$this->listeners[$eventName][0]) {
// Sorting
/** @psalm-suppress MixedArgument */
\array_multisort($this->listeners[$eventName][1], SORT_NUMERIC, $this->listeners[$eventName][2]);
// Marking the listeners as sorted
@@ -30,7 +30,6 @@ public function __construct(PluginListFactory $plugin_list_factory)
/**
* @return void
* @psalm-suppress UnusedMethod
*/
protected function configure()
{
@@ -42,7 +41,6 @@ protected function configure()
/**
* @return null|int
* @psalm-suppress UnusedMethod
*/
protected function execute(InputInterface $i, OutputInterface $o)
{
@@ -175,7 +175,6 @@ private function resolveSignature($node)
* @param PhpParser\Node|string|null $node
*
* @return null|PhpParser\Node\Identifier|PhpParser\Node\Name|PhpParser\Node\NullableType
* @psalm-suppress MoreSpecificReturnType
* @psalm-suppress InvalidReturnType
* @psalm-suppress InvalidReturnStatement
*/
@@ -142,7 +142,6 @@ public function listsCommands(string $command)
* @return void
* @dataProvider commands
* @test
* @psalm-suppress RedundantConditionGivenDocblockType
*/
public function showsHelpForCommand(string $command)
{
@@ -105,9 +105,7 @@ public function analyzeFile($file_path, \Psalm\Context $context, bool $track_unu
$this->project_analyzer->interpretRefactors();
}
if ($track_unused_suppressions) {
$this->project_analyzer->trackUnusedSuppressions();
}
$this->project_analyzer->trackUnusedSuppressions();
$file_analyzer = new FileAnalyzer(
$this->project_analyzer,
@@ -64,6 +64,8 @@ public function testValidCode($code, array $error_levels = [])
$this->analyzeFile($file_path, $context, false);
$this->project_analyzer->checkClassReferences();
\Psalm\IssueBuffer::processUnusedSuppressions($this->project_analyzer->getCodebase()->file_provider);
}
/**
@@ -98,9 +100,11 @@ public function testInvalidCode($code, $error_message, $error_levels = [])
$context = new Context();
$context->collect_references = true;
$this->analyzeFile($file_path, $context);
$this->analyzeFile($file_path, $context, false);
$this->project_analyzer->checkClassReferences();
\Psalm\IssueBuffer::processUnusedSuppressions($this->project_analyzer->getCodebase()->file_provider);
}
/**
@@ -499,6 +503,17 @@ function takesFoo(Foo $foo): Foo {
return $foo;
}',
],
'suppressUnusedMethod' => [
'<?php
class A {
/**
* @psalm-suppress UnusedMethod
*/
public function foo() : void {}
}
new A();'
],
];
}

0 comments on commit 6ea68e9

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