Skip to content
Permalink
Browse files

Fix error messages for `$boolVar !== null`

Seen for this example:

    $b = rand() % 2 > 0;
    if ($b !== null) { ... }
  • Loading branch information...
TysonAndre authored and muglug committed Apr 25, 2019
1 parent 0e4c8ce commit dbcedd300b140809db9fc496a4ffba8da075dd2e
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php
@@ -1028,7 +1028,7 @@ private static function scrapeInequalityAssertions(
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 @@ private static function scrapeInequalityAssertions(
} 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()

0 comments on commit dbcedd3

Please sign in to comment.
You can’t perform that action at this time.