1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Simplify output of method call complaints

This commit is contained in:
Brown 2019-01-07 16:38:37 -05:00
parent 5d5fbb1e9c
commit be337a03cf

View File

@ -115,8 +115,8 @@ class MethodCallAnalyzer extends \Psalm\Internal\Analyzer\Statements\Expression\
if ($class_type && $stmt->name instanceof PhpParser\Node\Identifier && $class_type->isNull()) {
if (IssueBuffer::accepts(
new NullReference(
'Cannot call method ' . $stmt->name->name . ' on null variable ' . $var_id,
new CodeLocation($statements_analyzer->getSource(), $stmt->var)
'Cannot call method ' . $stmt->name->name . ' on null value',
new CodeLocation($statements_analyzer->getSource(), $stmt->name)
),
$statements_analyzer->getSuppressedIssues()
)) {
@ -133,8 +133,8 @@ class MethodCallAnalyzer extends \Psalm\Internal\Analyzer\Statements\Expression\
) {
if (IssueBuffer::accepts(
new PossiblyNullReference(
'Cannot call method ' . $stmt->name->name . ' on possibly null variable ' . $var_id,
new CodeLocation($statements_analyzer->getSource(), $stmt->var)
'Cannot call method ' . $stmt->name->name . ' on possibly null value',
new CodeLocation($statements_analyzer->getSource(), $stmt->name)
),
$statements_analyzer->getSuppressedIssues()
)) {
@ -149,8 +149,8 @@ class MethodCallAnalyzer extends \Psalm\Internal\Analyzer\Statements\Expression\
) {
if (IssueBuffer::accepts(
new PossiblyFalseReference(
'Cannot call method ' . $stmt->name->name . ' on possibly false variable ' . $var_id,
new CodeLocation($statements_analyzer->getSource(), $stmt->var)
'Cannot call method ' . $stmt->name->name . ' on possibly false value',
new CodeLocation($statements_analyzer->getSource(), $stmt->name)
),
$statements_analyzer->getSuppressedIssues()
)) {