1
0
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:
Matthew Brown 2017-11-28 01:40:55 -05:00
parent f27bd50abe
commit e0cea0017c

View File

@ -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(