1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +01:00

Unused psalm-suppress (#4646)

This commit is contained in:
orklah 2020-11-21 23:39:40 +01:00 committed by GitHub
parent 509a937d1b
commit ae0486529e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 0 additions and 24 deletions

View File

@ -181,7 +181,6 @@ class Creator
);
}
/** @psalm-suppress MixedAssignment */
if (!$composer_json = json_decode(file_get_contents($composer_json_location), true)) {
throw new ConfigCreationException('Invalid composer.json at ' . $composer_json_location);
}

View File

@ -281,7 +281,6 @@ class TryAnalyzer
// discard all clauses because crazy stuff may have happened in try block
$catch_context->clauses = [];
/** @psalm-suppress RedundantConditionGivenDocblockType */
if ($catch->var && is_string($catch->var->name)) {
$catch_var_id = '$' . $catch->var->name;

View File

@ -1205,7 +1205,6 @@ class ArgumentAnalyzer
$context->vars_in_scope[$var_id] = new Type\Union([$unpacked_atomic_array]);
} elseif ($unpacked_atomic_array instanceof Type\Atomic\TArray) {
$unpacked_atomic_array = clone $unpacked_atomic_array;
/** @psalm-suppress PropertyTypeCoercion */
$unpacked_atomic_array->type_params[1] = $input_type;
$context->vars_in_scope[$var_id] = new Type\Union([$unpacked_atomic_array]);

View File

@ -653,7 +653,6 @@ class ArrayFetchAnalyzer
&& $offset_as->param_name === $original_type->param_name
&& $offset_as->defining_class === $original_type->defining_class
) {
/** @psalm-suppress PropertyTypeCoercion */
$type->type_params[1] = new Type\Union([
new Type\Atomic\TTemplateIndexedAccess(
$offset_as->param_name,
@ -740,7 +739,6 @@ class ArrayFetchAnalyzer
}
if ($in_assignment && $replacement_type) {
/** @psalm-suppress PropertyTypeCoercion */
$type->type_params[1] = Type::combineUnionTypes(
$type->type_params[1],
$replacement_type,

View File

@ -572,7 +572,6 @@ class ReturnAnalyzer
->getCodebase()
->getFunctionLikeStorage($statements_analyzer, $closure_id);
/** @psalm-suppress ArgumentTypeCoercion */
$parent_fn_storage = $statements_analyzer
->getCodebase()
->getFunctionLikeStorage(

View File

@ -185,7 +185,6 @@ class Populator
&& !$storage->is_interface
&& !$storage->is_trait
) {
/** @psalm-suppress PropertyTypeCoercion */
$storage->methods['__construct'] = $storage->methods[$fq_classlike_name_lc];
}
@ -1144,9 +1143,7 @@ class Populator
}
}
/** @psalm-suppress PropertyTypeCoercion */
$storage->declaring_method_ids[$aliased_method_name] = $declaring_method_id;
/** @psalm-suppress PropertyTypeCoercion */
$storage->inheritable_method_ids[$aliased_method_name] = $declaring_method_id;
}
}

View File

@ -65,7 +65,6 @@ class Reflection
$storage->abstract = $reflected_class->isAbstract();
$storage->is_interface = $reflected_class->isInterface();
/** @psalm-suppress PropertyTypeCoercion */
$storage->potential_declaring_method_ids['__construct'][$class_name_lower . '::__construct'] = true;
if ($reflected_parent_class) {

View File

@ -217,7 +217,6 @@ class Pool
} catch (\Throwable $t) {
// This can happen when developing Psalm from source without running `composer update`,
// or because of rare bugs in Psalm.
/** @psalm-suppress MixedArgument on Windows, for some reason */
$process_done_message = new ForkProcessErrorMessage(
$t->getMessage() . "\nStack trace in the forked worker:\n" . $t->getTraceAsString()
);

View File

@ -54,9 +54,7 @@ class OffsetShifterVisitor extends PhpParser\NodeVisitorAbstract
* @psalm-suppress MixedOperand
*/
$node->setAttribute('startFilePos', $attrs['startFilePos'] + $this->file_offset);
/** @psalm-suppress MixedOperand */
$node->setAttribute('endFilePos', $attrs['endFilePos'] + $this->file_offset);
/** @psalm-suppress MixedOperand */
$node->setAttribute('startLine', $attrs['startLine'] + $this->line_offset);
}
}

View File

@ -216,7 +216,6 @@ class PartialParserVisitor extends PhpParser\NodeVisitorAbstract
if ($error->hasColumnInfo()) {
/** @var array{startFilePos: int, endFilePos: int} */
$error_attrs = $error->getAttributes();
/** @psalm-suppress MixedOperand */
$error = new PhpParser\Error(
$error->getRawMessage(),
[
@ -297,7 +296,6 @@ class PartialParserVisitor extends PhpParser\NodeVisitorAbstract
$node->setAttribute('comments', $new_comments);
/** @psalm-suppress MixedOperand */
$node->setAttribute('startFilePos', $attrs['startFilePos'] + $start_offset);
} else {
$node->setAttribute('startFilePos', $stmt_start_pos + $start_offset);
@ -309,7 +307,6 @@ class PartialParserVisitor extends PhpParser\NodeVisitorAbstract
}
if ($line_offset !== 0) {
/** @psalm-suppress MixedOperand */
$node->setAttribute('startLine', $attrs['startLine'] + $line_offset);
}

View File

@ -57,7 +57,6 @@ class ComposerLock
private function read(string $file_name): array
{
/** @psalm-suppress MixedAssignment */
$contents = json_decode(file_get_contents($file_name), true);
if ($error = json_last_error()) {

View File

@ -30,13 +30,9 @@ class NodeDataProvider implements \Psalm\NodeTypeProvider
public function __construct()
{
/** @psalm-suppress PropertyTypeCoercion */
$this->node_types = new SplObjectStorage();
/** @psalm-suppress PropertyTypeCoercion */
$this->node_assertions = new SplObjectStorage();
/** @psalm-suppress PropertyTypeCoercion */
$this->node_if_true_assertions = new SplObjectStorage();
/** @psalm-suppress PropertyTypeCoercion */
$this->node_if_false_assertions = new SplObjectStorage();
}

View File

@ -191,7 +191,6 @@ class ParserCacheProvider
return [];
}
/** @psalm-suppress MixedAssignment */
$hashes_decoded = json_decode($hashes_encoded, true);
if (!is_array($hashes_decoded)) {

View File

@ -26,7 +26,6 @@ class CaseScope
public function __destruct()
{
/** @psalm-suppress PossiblyNullPropertyAssignmentValue */
$this->parent_context = null;
}
}

View File

@ -517,7 +517,6 @@ class IssueBuffer
}
}
/** @psalm-suppress PropertyTypeCoercion due to Psalm bug */
$issues_data[$file_path][$key] = $issue_data;
}
}