1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +01:00

Analyse binary ops always

This commit is contained in:
Brown 2019-07-22 18:04:52 -04:00
parent f15cc7dd5b
commit c283f0877d
2 changed files with 13 additions and 0 deletions

View File

@ -587,6 +587,7 @@ class CallAnalyzer
|| $arg->value instanceof PhpParser\Node\Expr\ArrayDimFetch
|| $arg->value instanceof PhpParser\Node\Expr\PropertyFetch
|| $arg->value instanceof PhpParser\Node\Expr\Array_
|| $arg->value instanceof PhpParser\Node\Expr\BinaryOp
) {
if (ExpressionAnalyzer::analyze($statements_analyzer, $arg->value, $context) === false) {
return false;

View File

@ -601,6 +601,18 @@ class MethodCallTest extends TestCase
}',
'error_message' => 'UndefinedThisPropertyFetch',
],
'complainAboutUndefinedPropertyOnMixedCallConcatOp' => [
'<?php
class A {
/**
* @psalm-suppress MixedMethodCall
*/
public function foo(object $a) : void {
$a->bar("bat" . $this->baz);
}
}',
'error_message' => 'UndefinedThisPropertyFetch',
],
];
}
}