call a function by reference and send this array filtered data to it as argument two
@param string $function
@param array $arguments
@return mixed
173420
private function sortableCallSpecial($function, $arguments)
    {
        $params = array_merge(
            array_slice($arguments, 0, 1),
            [$this->sortableConcreteData()],
            array_values(array_slice($arguments, 1))
        );
        return call_user_func_array($function, $params);
    }
480971
public function call($function, $params) {

		if(null === $this -> getAdapter()) {
			return trigger_error(sprintf('No database adapter was set in "%s"', __METHOD__), E_USER_ERROR);
		}

		if(null !== $function && false === is_string($function)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($function)), E_USER_ERROR);
		}

		if(false === is_array($params)) {
			return trigger_error(sprintf('Argument 2 passed to %s() must be of the type array, "%s" given', __METHOD__, gettype($params)), E_USER_ERROR);
		}

		$query  = sprintf('CALL %s(%s)', $function, implode(array_fill(0, count($params), '?'), ','));
		$output = $this -> getAdapter() -> query($query, $params) -> execute();

		return $output;
	}
1031463
public function each($function, array $params = array())
    {
        if (is_string($function)) {
            foreach ($this->members() as $m) {
                call_user_func_array(array($m, $function), $params);
            }
        } elseif ($function instanceof Closure) {
            foreach ($this->members() as $idx => $m) {
                $function($m, $idx);
            }
        } else {
            throw new Exception\InvalidArgumentException(
                sprintf('Argument must be an either a string or a Closure, %s passed.', gettype($model))
            );
        }
    }
360944
public static function curryArgs(callable $function, $args)
    {
        Arguments::define(Boa::func(), Boa::arr())->check($function, $args);

        // Counts required parameters.
        $required = function () use ($function) {
            return (new ReflectionFunction($function))
                ->getNumberOfRequiredParameters();
        };

        $isFulfilled = function (callable $function, $args) use ($required) {
            return count($args) >= $required($function);
        };

        if ($isFulfilled($function, $args)) {
            return static::apply($function, $args);
        }

        return function (...$funcArgs) use (
            $function,
            $args,
            $required,
            $isFulfilled
        ) {
            $newArgs = ArrayList::of($args)
                ->append(ArrayList::of($funcArgs))
                ->toArray();

            if ($isFulfilled($function, $newArgs)) {
                return static::apply($function, $newArgs);
            }

            return static::curryArgs($function, $newArgs);
        };
    }
661274
function select($funcs, ...$args) {
		if ( is_string($funcs) ) $funcs = array($funcs=>array_shift($args));
		$res = array();
		foreach ($funcs as $k => $cb) {
			if ( ! $this->offsetExists($k) ) continue;
			$v = $this[$k];
			if ( is_array($cb) && ( array_keys($cb) !== array(0, 1) || ! is_callable($cb) ) ) {
				$v = new Bag( (array) $v );
				$res[$k] = $v->select($cb, ...$args);
			} else {
				$res[$k] = is_callable($cb) ? $cb($v, ...$args) : $v;
			}
		}
		return $res;
	}
785754
public function invokeWith($arguments = [])
    {
        if (!$arguments instanceof Arguments) {
            $arguments = new Arguments($arguments);
        }

        return $this->invoker->callWith($this->customCallback, $arguments);
    }
116743
public function call($name, $arguments = [])
    {
        return $this->runViaLaravelCollection(function ($collection) use (
            $name,
            $arguments
        ) {
            return call_user_func_array(
                [$collection, $name],
                $this->coollectizeCallbacks($this->__toArray($arguments), $name)
            );
        },
        $name);
    }
213726
final public function call($method, array $arguments = array())
    {
        $this->definition->addMethodCall($method, static::processValue($arguments, true));

        return $this;
    }
959424
public function resolve(\ReflectionMethod $function, array $arguments)
    {
        // No `@ScenarioStateArgument` annotation found
        if (null === $this->reader->getMethodAnnotation($function, ScenarioStateArgument::class)) {
            return $arguments;
        }

        $paramsKeys = array_map(function (\ReflectionParameter $element) {
            return $element->getName();
        }, $function->getParameters());
        $store = $this->store->getStore();

        // Prepare arguments from annotations
        /** @var ScenarioStateArgument[] $annotations */
        $annotations = $this->reader->getMethodAnnotations($function);
        foreach ($annotations as $annotation) {
            if ($annotation instanceof ScenarioStateArgument &&
                in_array($annotation->getArgument(), $paramsKeys) &&
                $store->hasStateFragment($annotation->getName())
            ) {
                $arguments[$annotation->getArgument()] = $store->getStateFragment($annotation->getName());
            }
        }

        // Reorder arguments
        $params = [];
        foreach ($function->getParameters() as $parameter) {
            $name = $parameter->getName();
            $params[$name] = isset($arguments[$name]) ? $arguments[$name] : $arguments[$parameter->getPosition()];
        }

        return $params;
    }
537534
public function execute(callable $function, array $arguments = [])
    {
        $delayFunction = $this->delayFunction;
        $calcDelayFunction = $this->calcDelayFunction ?: [$this, 'calculateDelay'];
        $retryAttempt = 0;
        $exception = null;

        while (true) {
            try {
                return call_user_func_array($function, $arguments);
            } catch (\Exception $exception) {
                if ($this->retryFunction) {
                    if (!call_user_func($this->retryFunction, $exception)) {
                        throw $exception;
                    }
                }

                if ($retryAttempt >= $this->retries) {
                    break;
                }

                $delayFunction($calcDelayFunction($retryAttempt));
                $retryAttempt++;
            }
        }

        throw $exception;
    }
712202
function relay($funcs,$args=NULL) {
		foreach (is_array($funcs)?$funcs:$this->split($funcs) as $func)
			$args=[$this->call($func,$args)];
		return array_shift($args);
	}
37415
private static function getArguments(array $arguments = [])
    {
        $args = [];

        foreach ($arguments as $argument) {
            $args[] = $argument instanceof self ? $argument->getMoney() : $argument;
        }

        return $args;
    }
927222
public function invokeWith($arguments = [])
    {
        if (!$arguments instanceof Arguments) {
            $arguments = new Arguments($arguments);
        }

        if (!$this->isRecording) {
            return $this->invoker->callWith($this->callback, $arguments);
        }

        $call = $this->callFactory->record($this->callback, $arguments, $this);
        $responseEvent = $call->responseEvent();

        if ($responseEvent instanceof ThrewEvent) {
            $call->setEndEvent($responseEvent);

            throw $responseEvent->exception();
        }

        $returnValue = $responseEvent->value();

        if ($this->useGeneratorSpies && $returnValue instanceof Generator) {
            return $this->generatorSpyFactory->create($call, $returnValue);
        }

        if (
            $this->useIterableSpies &&
            (is_array($returnValue) || $returnValue instanceof Traversable)
        ) {
            return $this->iterableSpyFactory->create($call, $returnValue);
        }

        $call->setEndEvent($call->responseEvent());

        return $returnValue;
    }
369271
protected function callFunction($prefix, $format, array $arguments)
    {
        $function = "$prefix$format";

        if (!in_array($format, $this->getSupportedFormats())) {
            throw new RuntimeException("Unsupported image format $format");
        }

        if (!function_exists($function)) {
            throw new BadFunctionCallException("Function $function does not exist");
        }

        return call_user_func_array($function, $arguments);
    }
1221832
public function filterWithIndex(callable $function): Seq
    {
        $result = new Seq();

        foreach ($this->data as $key => $value) {
            if (!!$function($key, $value)) {
                $result = $result->append($value);
            }
        }

        return $result;
    }
585478
public static function arrayWalkRecursive(array $data, callable $function)
    {
        if (!is_array($data)) {
            return call_user_func($function, $data);
        }

        foreach ($data as $k => &$item) {
            $item = self::arrayWalkRecursive($data[$k], $function);
        }

        return $data;
    }
828022
public function fireReturn(string $event, array $arguments = null) {
        $return = [];
        $arguments = (array)$arguments;

        foreach ($this->getBindings($event) as $callback) {
            if (is_callable($callback)) {
                $return[] = call_user_func_array($callback, $arguments);
            }
        }
        return array_filter($return);
    }