1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 12:55:26 +01:00

Fix error messages for $boolVar !== null

Seen for this example:

    $b = rand() % 2 > 0;
    if ($b !== null) { ... }
This commit is contained in:
Tyson Andre 2019-04-25 13:43:05 -04:00 committed by Matthew Brown
parent 0e4c8ce482
commit dbcedd300b

View File

@ -1028,7 +1028,7 @@ class AssertionFinder
if ($var_type->from_docblock) { if ($var_type->from_docblock) {
if (IssueBuffer::accepts( if (IssueBuffer::accepts(
new RedundantConditionGivenDocblockType( new RedundantConditionGivenDocblockType(
'Docblock-asserted type ' . $var_type . ' can never contain an empty array', 'Docblock-asserted type ' . $var_type . ' can never contain null',
new CodeLocation($source, $conditional) new CodeLocation($source, $conditional)
), ),
$source->getSuppressedIssues() $source->getSuppressedIssues()
@ -1038,7 +1038,7 @@ class AssertionFinder
} else { } else {
if (IssueBuffer::accepts( if (IssueBuffer::accepts(
new RedundantCondition( new RedundantCondition(
$var_type . ' can never contain an empty array', $var_type . ' can never contain null',
new CodeLocation($source, $conditional) new CodeLocation($source, $conditional)
), ),
$source->getSuppressedIssues() $source->getSuppressedIssues()