PHPSA\Analyzer\Pass\Expression\FunctionCall\ArgumentUnpacking::pass PHP Метод

pass() публичный Метод

public pass ( PhpParser\Node\Expr\FuncCall $funcCall, Context $context )
$funcCall PhpParser\Node\Expr\FuncCall
$context PHPSA\Context
    public function pass(FuncCall $funcCall, Context $context)
    {
        $functionName = $this->resolveFunctionName($funcCall, $context);
        if ($functionName !== 'func_get_args') {
            return;
        }
        $scopePointer = $context->scopePointer->getObject();
        if ($scopePointer instanceof ClassMethod || $scopePointer instanceof FunctionDefinition) {
            if (count($scopePointer->getParams()) === 0) {
                $context->notice('fcall.argumentunpacking', sprintf('Please use argument unpacking (...) instead of func_get_args().'), $funcCall);
                return;
            }
        }
    }
ArgumentUnpacking