1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +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 (IssueBuffer::accepts(
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)
),
$source->getSuppressedIssues()
@ -1038,7 +1038,7 @@ class AssertionFinder
} else {
if (IssueBuffer::accepts(
new RedundantCondition(
$var_type . ' can never contain an empty array',
$var_type . ' can never contain null',
new CodeLocation($source, $conditional)
),
$source->getSuppressedIssues()