mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +01:00
Add more stringent checks when surfacing RedundantCondition
This commit is contained in:
parent
f27bd50abe
commit
e0cea0017c
@ -332,7 +332,7 @@ class TypeChecker
|
||||
}
|
||||
}
|
||||
|
||||
if (!$did_remove_type || empty($existing_var_type->types)) {
|
||||
if ((!$did_remove_type || empty($existing_var_type->types)) && !$existing_var_type->from_docblock) {
|
||||
if ($key && $code_location) {
|
||||
if (IssueBuffer::accepts(
|
||||
new RedundantCondition(
|
||||
@ -365,7 +365,7 @@ class TypeChecker
|
||||
$existing_var_type->removeType('null');
|
||||
}
|
||||
|
||||
if (!$did_remove_type || empty($existing_var_type->types)) {
|
||||
if ((!$did_remove_type || empty($existing_var_type->types)) && !$existing_var_type->from_docblock) {
|
||||
if ($key && $code_location) {
|
||||
if (IssueBuffer::accepts(
|
||||
new RedundantCondition(
|
||||
|
Loading…
Reference in New Issue
Block a user