private function callsFuncGetArgs($nodes) : bool
{
foreach ($nodes as $node) {
if (is_array($node)) {
if ($this->callsFuncGetArgs($node)) {
return true;
}
}
if (!$node instanceof \PhpParser\Node) {
continue;
}
if ($node instanceof ClassMethod) {
if ($node->getStmts() === null) {
continue;
// interface
}
$methodName = $node->name;
if ($methodName === $this->reflection->getName()) {
return $this->functionCallStatementFinder->findFunctionCallInStatements('func_get_args', $node->getStmts()) !== null;
}
}
if ($this->callsFuncGetArgs($node)) {
return true;
}
}
return false;
}