mirror of
https://github.com/danog/psalm.git
synced 2024-12-12 01:09:38 +01:00
unset instead of reassign
This commit is contained in:
parent
06da96843a
commit
41ea541084
@ -106,8 +106,8 @@ abstract class ClassLikeAnalyzer extends SourceAnalyzer
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
$this->source = null;
|
||||
$this->file_analyzer = null;
|
||||
unset($this->source);
|
||||
unset($this->file_analyzer);
|
||||
}
|
||||
|
||||
public function getMethodMutations(
|
||||
|
@ -662,7 +662,6 @@ class FileAnalyzer extends SourceAnalyzer
|
||||
|
||||
public function clearSourceBeforeDestruction() : void
|
||||
{
|
||||
/** @psalm-suppress PossiblyNullPropertyAssignmentValue */
|
||||
$this->source = null;
|
||||
unset($this->source);
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ abstract class SourceAnalyzer implements StatementsSource
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
$this->source = null;
|
||||
unset($this->source);
|
||||
}
|
||||
|
||||
public function getAliases(): Aliases
|
||||
|
@ -98,10 +98,9 @@ class SwitchCaseAnalyzer
|
||||
$case_context->inside_conditional = true;
|
||||
|
||||
if (ExpressionAnalyzer::analyze($statements_analyzer, $case->cond, $case_context) === false) {
|
||||
/** @psalm-suppress PossiblyNullPropertyAssignmentValue */
|
||||
$case_scope->parent_context = null;
|
||||
$case_context->case_scope = null;
|
||||
$case_context->parent_context = null;
|
||||
unset($case_scope->parent_context);
|
||||
unset($case_context->case_scope);
|
||||
unset($case_context->parent_context);
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -273,10 +272,9 @@ class SwitchCaseAnalyzer
|
||||
$switch_scope->leftover_statements = [$case_if_stmt];
|
||||
}
|
||||
|
||||
/** @psalm-suppress PossiblyNullPropertyAssignmentValue */
|
||||
$case_scope->parent_context = null;
|
||||
$case_context->case_scope = null;
|
||||
$case_context->parent_context = null;
|
||||
unset($case_scope->parent_context);
|
||||
unset($case_context->case_scope);
|
||||
unset($case_context->parent_context);
|
||||
|
||||
$statements_analyzer->node_data = $old_node_data;
|
||||
|
||||
@ -500,10 +498,9 @@ class SwitchCaseAnalyzer
|
||||
$case_exit_type,
|
||||
$switch_scope
|
||||
) === false) {
|
||||
/** @psalm-suppress PossiblyNullPropertyAssignmentValue */
|
||||
$case_scope->parent_context = null;
|
||||
$case_context->case_scope = null;
|
||||
$case_context->parent_context = null;
|
||||
unset($case_scope->parent_context);
|
||||
unset($case_context->case_scope);
|
||||
unset($case_context->parent_context);
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -558,10 +555,9 @@ class SwitchCaseAnalyzer
|
||||
}
|
||||
}
|
||||
|
||||
/** @psalm-suppress PossiblyNullPropertyAssignmentValue */
|
||||
$case_scope->parent_context = null;
|
||||
$case_context->case_scope = null;
|
||||
$case_context->parent_context = null;
|
||||
unset($case_scope->parent_context);
|
||||
unset($case_context->case_scope);
|
||||
unset($case_context->parent_context);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user