Skip to content
Permalink
Browse files

Analyse binary ops always

  • Loading branch information...
muglug committed Jul 22, 2019
1 parent f15cc7d commit c283f0877d543e7ab738d231ba6a3cdce5e1039a
Showing with 13 additions and 0 deletions.
  1. +1 −0 src/Psalm/Internal/Analyzer/Statements/Expression/CallAnalyzer.php
  2. +12 −0 tests/MethodCallTest.php
@@ -587,6 +587,7 @@ private static function evaluateAribitraryParam(
|| $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;
@@ -601,6 +601,18 @@ public function foo($a) : void {
}',
'error_message' => 'UndefinedThisPropertyFetch',
],
'complainAboutUndefinedPropertyOnMixedCallConcatOp' => [
'<?php
class A {
/**
* @psalm-suppress MixedMethodCall
*/
public function foo(object $a) : void {
$a->bar("bat" . $this->baz);
}
}',
'error_message' => 'UndefinedThisPropertyFetch',
],
];
}
}

0 comments on commit c283f08

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