@param $funcName
@param $args

@return array
969842
public function beforeExec($funcName, $args)
    {
        $result = array();
        if (!empty($this->interceptorData[$funcName])) {
            $log = $this->interceptorData[$funcName];
            $formats = $log['format'];
            if (!empty($formats)) {
                $formats = str_replace("'", '"', $formats);
                $formats = json_decode($formats, true);
                if (isset($formats['before'])) {
                    $format = $formats['before'];
                    $service = $this->biz->service($format['className']);
                    $formatFuncName = $format['funcName'];
                    $arguments = $this->getArrayValue($log['funcParam'], $format['param'], $args);
                    $formatReturn = $service->$formatFuncName($arguments[0]);
                    $result = $formatReturn;
                }
            }
        }

        return $result;
    }
1020265
public function get($propertyName, $funcName, array $arguments = [], array &$errorValues = [], array &$errors)
    {
        if (false === \array_key_exists($funcName, $this->functionMap)) {
            throw new \InvalidArgumentException(
                \sprintf('Validator key \'%s\' not found', $funcName)
            );
        }

        $function = $this->functionMap[$funcName];
        $class    = \explode("::", $function);

        try {
            $result = \call_user_func_array([$class[0], $class[1]], $arguments);

            if (false === $result) {
                $funcName = $this->funcNameToUnderscore($funcName);
                if (false === \array_key_exists($funcName, $errors)) {
                    throw new \InvalidArgumentException(
                        \sprintf('Validator key \'%s\' not found in error file', $funcName)
                    );
                }

                if (\strlen($errors[$funcName]) > 0) {
                    $this->validator->setError(
                        $this->buildErrorMessage($errorValues, $errors, $funcName, $propertyName),
                        $funcName
                    );
                }
            }
        } catch (FileUploadException $e) {
            $lowerCaseFuncName = $this->funcNameToUnderscore($e->getMessage());
            $this->validator->setError(
                $this->buildErrorMessage($errorValues, $errors, $e->getMessage(), $propertyName),
                $lowerCaseFuncName
            );

            $result = false;
        }

        return $result;
    }
212707
public function getArguments($name)
    {
        if (null === $this->data) {
            $this->initializeProfile();
        }

        if (!isset($this->data['arguments'][$name])) {
            return array();
        }

        $arguments = array();
        foreach ($this->data['arguments'][$name] as $argument => $cost) {
            $arguments[$argument] = new Cost($cost);
        }

        return $arguments;
    }
839595
private function getInjectionFuncParams(Argument $argument) : array
    {
        $dependencyIndex = (string) $argument;
        if ($this->container->getContainer()[$dependencyIndex] instanceof DependencyProvider) {
            return $this->getInjectionProviderParams($argument);
        }

        return [new Node\Arg(new Scalar\String_((string) $argument))];
    }
398187
private function getFunctionArgumentsNames($closure) : array
    {
        $result = [];

        $closureReflection = new ReflectionFunction($closure);

        foreach ($closureReflection->getParameters() as $param) {
            $result[] = $param->name;
        }

        return $result;
    }
20863
public function getParameter( $name, $func_str=null, $setParam=true ) {

		if ( !$func_str ) return urldecode($this->parameters[$name]) ? urldecode($this->parameters[$name]) : $this->parameters[$name];

        $funcs = explode("|", $func_str);
        $args = urldecode($this->parameters[$name]);
        foreach ( $funcs as $func ) {
            $args = call_user_func($func, $args);
        }
        if ( $setParam ) {
            $this->parameters[$name] = $args;
        }
        return $args;

    }
951419
private function arrayHelperMethod( $fn, array $args )
    {

        $class = $this->classGet();
        $fnArguments = array( $this->collection );

        foreach( $args as $container ) {

            // validate the arguments
            if( !( $container instanceof $this ) ) {
                throw new \InvalidArgumentException("You can only `{$fn}` containers.");
            }
            $containerClass = $container->classGet();
            if( isset($class) and isset( $containerClass ) and ( $class !== $containerClass ) ) {
                throw new IncompatibleContainerException("Container -> `{$containerClass}` not compatible with `{$class}`");
            }

            $fnArguments[] = $container->collection;

        }

        $output = $this->newContainer(
            call_user_func_array(
                $fn,
                $fnArguments
            )
        );
        return $output;

    }
171692
public function callFunction($functionName, $parameters)
    {
        if ($functionName == 'getList') {
            $oObject = $this->getObject();
            $mResponse = $this->_formArrayFromList($oObject->getList());
        } else {
            $mResponse = parent::callFunction($functionName, $parameters);
        }

        return $mResponse;
    }
399963
private function invokeInternalStreamWrapper(string $functionName, ...$arguments)
    {
        $silentExecution = $functionName{0} === '@';
        $functionName = ltrim($functionName, '@');
        $this->restoreInternalSteamWrapper();

        try {
            if ($silentExecution) {
                $result = @call_user_func_array($functionName, $arguments);
            } else {
                $result = call_user_func_array($functionName, $arguments);
            }
        } finally {
            $this->registerStreamWrapper();
        }

        return $result;
    }
440616
protected function callFunction(\Closure $function, $value, array $args = [])
    {
        if ($value instanceof Monadic && !$value instanceof Collection) {
            return $value->bind($function, $args);
        }

        $val = ($value instanceof \Closure ? $value() : $value);
        array_unshift($args, $val);

        return call_user_func_array($function, $args);
    }
332566
protected function callWithFixtures($functionName, array $arguments = array(), &$resultArguments = null)
    {
        if ($this->usesFixtures()) {
            // Determine fixture file name
            $fingerprintArguments = $this->getFixtureFingerprintArguments($arguments);
            $fixture = new FileFixture($this->_fixturePath . FileFixture::getFilename($this->getFixturePrefix() . '_' . $functionName, $fingerprintArguments));

            // Try to find existing fixture file
            try {
                $fixture->find();

                $result = $fixture->getResult();

                // Throw exception or return value?
                if (is_object($result) && $result instanceof \Exception) {
                    throw $result;
                }

                $resultArguments = $fixture->getArguments();

                return $result;
            } catch (FixtureNotFoundException $e) {
                // No fixture found, the original method has to be called
            }
        }

        if ($this->fixtureOfflineModeEnabled()) {
            throw new OfflineException('Can not create fixture for ' . $functionName . '() in offline mode');
        }

        $throwException = false;

        // Catch exceptions to be able to create fixtures for them as well
        try {
            $result = call_user_func_array(array($this->_fixtureInstance, $functionName), $arguments);
        } catch (\Exception $e) {
            $result = $e;
            $throwException = true;
        }

        // Write return value / exception to file fixture
        if ($this->usesFixtures()) {
            $resultArguments = $arguments;
            $fixture->setResult($result);
            $fixture->setArguments($arguments);
            $fixture->save();
        }

        // Throw exception or return value?
        if ($throwException) {
            throw $result;
        }

        return $result;
    }
336329
public function findAll($selector, $function, $arguments = array())
    {
        if (!$this->parser) {
            return;
        }

        $nodes = $this->parser->find($selector);

        if (!$nodes) {
            return;
        }

        if (!is_array($arguments)) {
            $arguments = array($arguments);
        }

        $results = array();

        foreach ($nodes as $node) {
            $results[] = call_user_func_array(array($node, $function), $arguments);
        }

        return $results;
    }
1251044
protected function getSplatCallVars($args)
    {
        $isSplatCall = false;
        $variables = [];
        foreach ($args as $arg) {
            if ($arg->unpack) {
                $isSplatCall = true;
            }
            $variables[] = $arg->value;
        }
        if (! $isSplatCall) {
            return;
        }
        return $variables;
    }
1043672
protected function callClientMethod($name, array $arguments = array())
    {
        $this->logDebug("$name(" . implode(",", $arguments) . ")");
        return call_user_func_array(array($this->client, $name), $arguments);
    }
1025743
public function formatFunction(Func $func) {
        $arguments = [];

        foreach ($func->getArguments() as $arg) {
            $type = $arg['type'];
            $value = $arg['value'];

            if ($value instanceof Func) {
                $value = $this->formatFunction($value);

            } else if ($value instanceof SubQuery) {
                $value = $this->formatSubQuery($value);

            } else if ($type === Func::FIELD) {
                $value = $this->quote($value);

            } else if ($type === Func::LITERAL) {
                // Do nothing

            } else if (is_string($value) || $value === null) {
                $value = $this->getDriver()->escape($value);
            }

            $arguments[] = $value;
        }

        $output = sprintf($this->getClause(self::FUNC),
            $func->getName(),
            implode($func->getSeparator(), $arguments)
        );

        if ($alias = $func->getAlias()) {
            $output = sprintf($this->getClause(self::AS_ALIAS), $output, $this->quote($alias));
        }

        return $output;
    }
915938
public static function get($funcName)
	{
		if (isset(self::$cache[$funcName]))
		{
			return self::$cache[$funcName];
		}
		if (preg_match('(^[a-z_0-9]+$)D', $funcName))
		{
			$filepath = __DIR__ . '/functions/' . $funcName . '.js';
			if (file_exists($filepath))
			{
				return file_get_contents($filepath);
			}
		}
		throw new InvalidArgumentException("Unknown function '" . $funcName . "'");
	}
682152
function getFunctionArgs(args) {
        if (args.length > 2) {
            var fnArgs = new Array(args.length - 2),
                i;
            for (i = 2; i < args.length; ++i) {
                fnArgs[i - 2] = args[i];
            }
            return fnArgs;
        }
        return [];
    }