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()
|
public function __destruct()
|
||||||
{
|
{
|
||||||
$this->source = null;
|
unset($this->source);
|
||||||
$this->file_analyzer = null;
|
unset($this->file_analyzer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getMethodMutations(
|
public function getMethodMutations(
|
||||||
|
@ -662,7 +662,6 @@ class FileAnalyzer extends SourceAnalyzer
|
|||||||
|
|
||||||
public function clearSourceBeforeDestruction() : void
|
public function clearSourceBeforeDestruction() : void
|
||||||
{
|
{
|
||||||
/** @psalm-suppress PossiblyNullPropertyAssignmentValue */
|
unset($this->source);
|
||||||
$this->source = null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ abstract class SourceAnalyzer implements StatementsSource
|
|||||||
|
|
||||||
public function __destruct()
|
public function __destruct()
|
||||||
{
|
{
|
||||||
$this->source = null;
|
unset($this->source);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAliases(): Aliases
|
public function getAliases(): Aliases
|
||||||
|
@ -98,10 +98,9 @@ class SwitchCaseAnalyzer
|
|||||||
$case_context->inside_conditional = true;
|
$case_context->inside_conditional = true;
|
||||||
|
|
||||||
if (ExpressionAnalyzer::analyze($statements_analyzer, $case->cond, $case_context) === false) {
|
if (ExpressionAnalyzer::analyze($statements_analyzer, $case->cond, $case_context) === false) {
|
||||||
/** @psalm-suppress PossiblyNullPropertyAssignmentValue */
|
unset($case_scope->parent_context);
|
||||||
$case_scope->parent_context = null;
|
unset($case_context->case_scope);
|
||||||
$case_context->case_scope = null;
|
unset($case_context->parent_context);
|
||||||
$case_context->parent_context = null;
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -273,10 +272,9 @@ class SwitchCaseAnalyzer
|
|||||||
$switch_scope->leftover_statements = [$case_if_stmt];
|
$switch_scope->leftover_statements = [$case_if_stmt];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @psalm-suppress PossiblyNullPropertyAssignmentValue */
|
unset($case_scope->parent_context);
|
||||||
$case_scope->parent_context = null;
|
unset($case_context->case_scope);
|
||||||
$case_context->case_scope = null;
|
unset($case_context->parent_context);
|
||||||
$case_context->parent_context = null;
|
|
||||||
|
|
||||||
$statements_analyzer->node_data = $old_node_data;
|
$statements_analyzer->node_data = $old_node_data;
|
||||||
|
|
||||||
@ -500,10 +498,9 @@ class SwitchCaseAnalyzer
|
|||||||
$case_exit_type,
|
$case_exit_type,
|
||||||
$switch_scope
|
$switch_scope
|
||||||
) === false) {
|
) === false) {
|
||||||
/** @psalm-suppress PossiblyNullPropertyAssignmentValue */
|
unset($case_scope->parent_context);
|
||||||
$case_scope->parent_context = null;
|
unset($case_context->case_scope);
|
||||||
$case_context->case_scope = null;
|
unset($case_context->parent_context);
|
||||||
$case_context->parent_context = null;
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -558,10 +555,9 @@ class SwitchCaseAnalyzer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @psalm-suppress PossiblyNullPropertyAssignmentValue */
|
unset($case_scope->parent_context);
|
||||||
$case_scope->parent_context = null;
|
unset($case_context->case_scope);
|
||||||
$case_context->case_scope = null;
|
unset($case_context->parent_context);
|
||||||
$case_context->parent_context = null;
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user