From 427eecdcd837ba6e72a63870041d520a5d496ba6 Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Fri, 11 Mar 2022 22:02:55 -0500 Subject: [PATCH] Remove unnecessary switch statement code --- .../Statements/Block/SwitchCaseAnalyzer.php | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/Psalm/Internal/Analyzer/Statements/Block/SwitchCaseAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Block/SwitchCaseAnalyzer.php index 49177b5b4..3b0e86a36 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Block/SwitchCaseAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Block/SwitchCaseAnalyzer.php @@ -464,12 +464,6 @@ class SwitchCaseAnalyzer ); } - $pre_possibly_assigned_var_ids = $case_context->possibly_assigned_var_ids; - $case_context->possibly_assigned_var_ids = []; - - $pre_assigned_var_ids = $case_context->assigned_var_ids; - $case_context->assigned_var_ids = []; - $statements_analyzer->analyze($case_stmts, $case_context); $traverser = new PhpParser\NodeTraverser; @@ -484,15 +478,6 @@ class SwitchCaseAnalyzer $statements_analyzer->node_data = $old_node_data; - /** @var array */ - $new_case_assigned_var_ids = $case_context->assigned_var_ids; - $case_context->assigned_var_ids = $pre_assigned_var_ids + $new_case_assigned_var_ids; - - /** @var array */ - $new_case_possibly_assigned_var_ids = $case_context->possibly_assigned_var_ids; - $case_context->possibly_assigned_var_ids = - $pre_possibly_assigned_var_ids + $new_case_possibly_assigned_var_ids; - $context->referenced_var_ids = array_merge( $context->referenced_var_ids, $case_context->referenced_var_ids