src/Viserio/Component/Container/ContainerResolver.php
public function resolveFunction($function, array $parameters = [])
    {
        $reflectionFunction   = new ReflectionFunction($function);
        $reflectionParameters = $reflectionFunction->getParameters();
        $this->buildStack[]   = $reflectionFunction->name;
        $resolvedParameters   = $this->resolveParameters($reflectionParameters, $parameters);

        \array_pop($this->buildStack);

        return $reflectionFunction->invokeArgs($resolvedParameters);
    }
public function resolveFunction($function, array $parameters = [])
    {
        $reflectionFunction   = new ReflectionFunction($function);
        $reflectionParameters = $reflectionFunction->getParameters();
        $this->buildStack[]   = $reflectionFunction->name;
        $resolvedParameters   = $this->resolveParameters($reflectionParameters, $parameters);

        \array_pop($this->buildStack);

        return $reflectionFunction->invokeArgs($resolvedParameters);
    }
Resolve a closure / function.

@param callable|string $function
@param array           $parameters

@throws \Viserio\Component\Contract\Container\Exception\BindingResolutionException
@throws \Viserio\Component\Contract\Container\Exception\CyclicDependencyException
@throws \ReflectionException

@return mixed