diff --git a/src/Psalm/Config/Creator.php b/src/Psalm/Config/Creator.php index 633211c30c7..dc7cee6247a 100644 --- a/src/Psalm/Config/Creator.php +++ b/src/Psalm/Config/Creator.php @@ -181,7 +181,6 @@ public static function getPaths(string $current_dir, ?string $suggested_dir): ar ); } - /** @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); } diff --git a/src/Psalm/Internal/Analyzer/Statements/Block/TryAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Block/TryAnalyzer.php index 71112982c62..7f8a82f68e5 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Block/TryAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Block/TryAnalyzer.php @@ -281,7 +281,6 @@ public static function analyze( // 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; diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php index 64daf09d1b3..aa6d4537907 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php @@ -1205,7 +1205,6 @@ private static function coerceValueAfterGatekeeperArgument( $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]); diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php index 40d369e4300..dee947126d6 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php @@ -653,7 +653,6 @@ public static function getArrayAccessTypeGivenOffset( && $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 @@ public static function getArrayAccessTypeGivenOffset( } if ($in_assignment && $replacement_type) { - /** @psalm-suppress PropertyTypeCoercion */ $type->type_params[1] = Type::combineUnionTypes( $type->type_params[1], $replacement_type, diff --git a/src/Psalm/Internal/Analyzer/Statements/ReturnAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/ReturnAnalyzer.php index 79253c6e173..9961a072418 100644 --- a/src/Psalm/Internal/Analyzer/Statements/ReturnAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/ReturnAnalyzer.php @@ -572,7 +572,6 @@ private static function potentiallyInferTypesOnClosureFromParentReturnType( ->getCodebase() ->getFunctionLikeStorage($statements_analyzer, $closure_id); - /** @psalm-suppress ArgumentTypeCoercion */ $parent_fn_storage = $statements_analyzer ->getCodebase() ->getFunctionLikeStorage( diff --git a/src/Psalm/Internal/Codebase/Populator.php b/src/Psalm/Internal/Codebase/Populator.php index b3a0cc54b21..9240bfdfb37 100644 --- a/src/Psalm/Internal/Codebase/Populator.php +++ b/src/Psalm/Internal/Codebase/Populator.php @@ -185,7 +185,6 @@ private function populateClassLikeStorage(ClassLikeStorage $storage, array $depe && !$storage->is_interface && !$storage->is_trait ) { - /** @psalm-suppress PropertyTypeCoercion */ $storage->methods['__construct'] = $storage->methods[$fq_classlike_name_lc]; } @@ -1144,9 +1143,7 @@ protected function inheritMethodsFromParent( } } - /** @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; } } diff --git a/src/Psalm/Internal/Codebase/Reflection.php b/src/Psalm/Internal/Codebase/Reflection.php index 25d8c9d4d12..22039d0d2b6 100644 --- a/src/Psalm/Internal/Codebase/Reflection.php +++ b/src/Psalm/Internal/Codebase/Reflection.php @@ -65,7 +65,6 @@ public function registerClass(\ReflectionClass $reflected_class): void $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) { diff --git a/src/Psalm/Internal/Fork/Pool.php b/src/Psalm/Internal/Fork/Pool.php index 2fbff4290dc..e88c199f0c8 100644 --- a/src/Psalm/Internal/Fork/Pool.php +++ b/src/Psalm/Internal/Fork/Pool.php @@ -217,7 +217,6 @@ public function __construct( } 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() ); diff --git a/src/Psalm/Internal/PhpVisitor/OffsetShifterVisitor.php b/src/Psalm/Internal/PhpVisitor/OffsetShifterVisitor.php index 8a729d692fd..1503a6d512a 100644 --- a/src/Psalm/Internal/PhpVisitor/OffsetShifterVisitor.php +++ b/src/Psalm/Internal/PhpVisitor/OffsetShifterVisitor.php @@ -54,9 +54,7 @@ public function enterNode(PhpParser\Node $node) * @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); } } diff --git a/src/Psalm/Internal/PhpVisitor/PartialParserVisitor.php b/src/Psalm/Internal/PhpVisitor/PartialParserVisitor.php index e2920ece657..0f276636291 100644 --- a/src/Psalm/Internal/PhpVisitor/PartialParserVisitor.php +++ b/src/Psalm/Internal/PhpVisitor/PartialParserVisitor.php @@ -216,7 +216,6 @@ public function enterNode(PhpParser\Node $node, &$traverseChildren = true) 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 @@ public function enterNode(PhpParser\Node $node, &$traverseChildren = true) $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 @@ public function enterNode(PhpParser\Node $node, &$traverseChildren = true) } if ($line_offset !== 0) { - /** @psalm-suppress MixedOperand */ $node->setAttribute('startLine', $attrs['startLine'] + $line_offset); } diff --git a/src/Psalm/Internal/PluginManager/ComposerLock.php b/src/Psalm/Internal/PluginManager/ComposerLock.php index cd48e2f88ce..105e5b0e52c 100644 --- a/src/Psalm/Internal/PluginManager/ComposerLock.php +++ b/src/Psalm/Internal/PluginManager/ComposerLock.php @@ -57,7 +57,6 @@ public function getPlugins(): array private function read(string $file_name): array { - /** @psalm-suppress MixedAssignment */ $contents = json_decode(file_get_contents($file_name), true); if ($error = json_last_error()) { diff --git a/src/Psalm/Internal/Provider/NodeDataProvider.php b/src/Psalm/Internal/Provider/NodeDataProvider.php index d70f91fa472..54718dc9852 100644 --- a/src/Psalm/Internal/Provider/NodeDataProvider.php +++ b/src/Psalm/Internal/Provider/NodeDataProvider.php @@ -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(); } diff --git a/src/Psalm/Internal/Provider/ParserCacheProvider.php b/src/Psalm/Internal/Provider/ParserCacheProvider.php index 931631ff9b5..7964a45a6a5 100644 --- a/src/Psalm/Internal/Provider/ParserCacheProvider.php +++ b/src/Psalm/Internal/Provider/ParserCacheProvider.php @@ -191,7 +191,6 @@ private function getExistingFileContentHashes(): array return []; } - /** @psalm-suppress MixedAssignment */ $hashes_decoded = json_decode($hashes_encoded, true); if (!is_array($hashes_decoded)) { diff --git a/src/Psalm/Internal/Scope/CaseScope.php b/src/Psalm/Internal/Scope/CaseScope.php index bad6dc99471..220ac60e5e3 100644 --- a/src/Psalm/Internal/Scope/CaseScope.php +++ b/src/Psalm/Internal/Scope/CaseScope.php @@ -26,7 +26,6 @@ public function __construct(Context $parent_context) public function __destruct() { - /** @psalm-suppress PossiblyNullPropertyAssignmentValue */ $this->parent_context = null; } } diff --git a/src/Psalm/IssueBuffer.php b/src/Psalm/IssueBuffer.php index a3c32aaf9ec..57bcde596f2 100644 --- a/src/Psalm/IssueBuffer.php +++ b/src/Psalm/IssueBuffer.php @@ -517,7 +517,6 @@ function (IssueData $d1, IssueData $d2) : int { } } - /** @psalm-suppress PropertyTypeCoercion due to Psalm bug */ $issues_data[$file_path][$key] = $issue_data; } }