Sstalle\php7cc\NodeVisitor\ForeachVisitor::hasFunctionCallWithForeachArgument PHP Метод

hasFunctionCallWithForeachArgument() защищенный Метод

protected hasFunctionCallWithForeachArgument ( PhpParser\Node $node, array $functions, null | boolean $skippedByRefType = null ) : boolean
$node PhpParser\Node
$functions array
$skippedByRefType null | boolean Reference type (by value/by reference) to skip
Результат boolean
    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;
    }