private function variableMethodCallsUsed(array $nodes)
{
foreach ($nodes as $node) {
if ($node instanceof MethodCall && $node->name instanceof Variable) {
// A method call uses a Variable as its name
return true;
}
// Recurse over child nodes
if (isset($node->stmts) && is_array($node->stmts)) {
$used = $this->variableMethodCallsUsed($node->stmts);
if ($used) {
return true;
}
}
}
return false;
}