1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

Fix erroneous message for invalid right operands

This commit is contained in:
Matthew Brown 2018-03-18 16:46:26 -04:00
parent d7a585160f
commit e0bdfeb625

View File

@ -874,10 +874,12 @@ class BinaryOpChecker
}
if ($invalid_right_messages && $statements_source) {
$first_right_message = $invalid_right_messages[0];
if ($has_valid_right_operand) {
if (IssueBuffer::accepts(
new PossiblyInvalidOperand(
'Cannot add an array to a non-array ' . $right_type,
$first_right_message,
new CodeLocation($statements_source, $right)
),
$statements_source->getSuppressedIssues()
@ -887,7 +889,7 @@ class BinaryOpChecker
} else {
if (IssueBuffer::accepts(
new InvalidOperand(
'Cannot add an array to a non-array ' . $right_type,
$first_right_message,
new CodeLocation($statements_source, $right)
),
$statements_source->getSuppressedIssues()