mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 04:45:20 +01:00
Ignore PossiblyNullReference on synthetic method calls
This commit is contained in:
parent
7a48225184
commit
569d82641d
@ -364,11 +364,21 @@ class PropertyAssignmentAnalyzer
|
||||
]
|
||||
);
|
||||
|
||||
$suppressed_issues = $statements_analyzer->getSuppressedIssues();
|
||||
|
||||
if (!in_array('PossiblyNullReference', $suppressed_issues, true)) {
|
||||
$statements_analyzer->addSuppressedIssues(['PossiblyNullReference']);
|
||||
}
|
||||
|
||||
\Psalm\Internal\Analyzer\Statements\Expression\Call\MethodCallAnalyzer::analyze(
|
||||
$statements_analyzer,
|
||||
$fake_method_call,
|
||||
$context
|
||||
);
|
||||
|
||||
if (!in_array('PossiblyNullReference', $suppressed_issues, true)) {
|
||||
$statements_analyzer->removeSuppressedIssues(['PossiblyNullReference']);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -492,12 +492,22 @@ class PropertyFetchAnalyzer
|
||||
]
|
||||
);
|
||||
|
||||
$suppressed_issues = $statements_analyzer->getSuppressedIssues();
|
||||
|
||||
if (!in_array('PossiblyNullReference', $suppressed_issues, true)) {
|
||||
$statements_analyzer->addSuppressedIssues(['PossiblyNullReference']);
|
||||
}
|
||||
|
||||
\Psalm\Internal\Analyzer\Statements\Expression\Call\MethodCallAnalyzer::analyze(
|
||||
$statements_analyzer,
|
||||
$fake_method_call,
|
||||
$context
|
||||
);
|
||||
|
||||
if (!in_array('PossiblyNullReference', $suppressed_issues, true)) {
|
||||
$statements_analyzer->removeSuppressedIssues(['PossiblyNullReference']);
|
||||
}
|
||||
|
||||
$stmt->inferredType = $fake_method_call->inferredType ?? Type::getMixed();
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user