protected function hasFunctionCallWithForeachArgument(Node $node, array $functions, $skippedByRefType = null)
{
if (!$this->functionAnalyzer->isFunctionCallByStaticName($node, $functions)) {
return false;
}
/** @var Node\Expr\FuncCall $node */
foreach ($node->args as $argument) {
/** @var Node\Stmt\Foreach_ $foreach */
foreach ($this->getCurrentLoopStack() as $foreach) {
if ($skippedByRefType !== null && $foreach->byRef === $skippedByRefType) {
continue;
}
if ($argument->value instanceof Node\Expr\Variable && $argument->value->name === $this->getForeachVariableName($foreach)) {
return true;
}
}
}
return false;
}