Skip to content
Permalink
Browse files

Fix #2023 - no UnusedVariable complaint when method is undefined

  • Loading branch information...
muglug committed Aug 15, 2019
1 parent e25ce15 commit 57386ab26ebbbb87415382dc851b78f57dda0355
@@ -886,6 +886,16 @@ function (PhpParser\Node\Arg $arg) {
return;
}
if (self::checkFunctionArguments(
$statements_analyzer,
$args,
null,
null,
$context
) === false) {
return false;
}
if ($all_intersection_return_type && $all_intersection_existent_method_ids) {
$existent_method_ids = array_merge($existent_method_ids, $all_intersection_existent_method_ids);
@@ -1077,6 +1077,17 @@ function foo(object $mock) : void {
echo $b;
}',
],
'noUnusedVariableWhenUndefinedMethod' => [
'<?php
class A {}
function foo(A $a) : void {
$i = 0;
/** @psalm-suppress UndefinedMethod */
$a->bar($i);
}',
],
];
}

0 comments on commit 57386ab

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