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

Fix #587 - check RHS of assignments for variadic receptors

This commit is contained in:
Matthew Brown 2018-03-17 15:01:13 -04:00
parent 95b5f205c4
commit a51e67018e

View File

@ -770,10 +770,11 @@ class DependencyFinderVisitor extends PhpParser\NodeVisitorAbstract implements P
) {
// pick up func_get_args that would otherwise be missed
foreach ($stmt->stmts as $function_stmt) {
if ($function_stmt instanceof PhpParser\Node\Expr\FuncCall
&& $function_stmt->name instanceof PhpParser\Node\Name
if ($function_stmt instanceof PhpParser\Node\Expr\Assign
&& ($function_stmt->expr instanceof PhpParser\Node\Expr\FuncCall)
&& ($function_stmt->expr->name instanceof PhpParser\Node\Name)
) {
$function_id = implode('\\', $function_stmt->name->parts);
$function_id = implode('\\', $function_stmt->expr->name->parts);
if ($function_id === 'func_get_arg'
|| $function_id === 'func_get_args'