mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
Fix issues found by Psalm
This commit is contained in:
parent
6b7788b502
commit
9ab3161675
@ -624,8 +624,9 @@ class FileAnalyzer extends SourceAnalyzer implements StatementsSource
|
||||
return $this->first_statement_offset;
|
||||
}
|
||||
|
||||
public function clearSourceBeforeDestruction()
|
||||
public function clearSourceBeforeDestruction() : void
|
||||
{
|
||||
/** @psalm-suppress PossiblyNullPropertyAssignmentValue */
|
||||
$this->source = null;
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,8 @@ abstract class SourceAnalyzer implements StatementsSource
|
||||
*/
|
||||
protected $source;
|
||||
|
||||
public function __destruct() {
|
||||
public function __destruct()
|
||||
{
|
||||
/** @psalm-suppress PossiblyNullPropertyAssignmentValue */
|
||||
$this->source = null;
|
||||
}
|
||||
|
@ -256,6 +256,7 @@ class SwitchAnalyzer
|
||||
|
||||
if ($case->cond) {
|
||||
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;
|
||||
@ -367,6 +368,7 @@ class SwitchAnalyzer
|
||||
$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;
|
||||
@ -530,6 +532,7 @@ class SwitchAnalyzer
|
||||
$switch_scope,
|
||||
$case_scope
|
||||
) === false) {
|
||||
/** @psalm-suppress PossiblyNullPropertyAssignmentValue */
|
||||
$case_scope->parent_context = null;
|
||||
$case_context->case_scope = null;
|
||||
$case_context->parent_context = null;
|
||||
@ -591,6 +594,7 @@ class SwitchAnalyzer
|
||||
}
|
||||
}
|
||||
|
||||
/** @psalm-suppress PossiblyNullPropertyAssignmentValue */
|
||||
$case_scope->parent_context = null;
|
||||
$case_context->case_scope = null;
|
||||
$case_context->parent_context = null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user