public function resolveClosure(\Closure $closure)
    {
        $reflection = new \ReflectionFunction($closure);

        $dependencies = $reflection->getParameters();
        $instances = $this->resolveDependencies($dependencies); // Actually resolve the dependencies
        $o = $reflection->invokeArgs($instances);

        return $o;
    }
public function resolveClosure(\Closure $closure)
    {
        $reflection = new \ReflectionFunction($closure);

        $dependencies = $reflection->getParameters();
        $instances = $this->resolveDependencies($dependencies); // Actually resolve the dependencies
        $o = $reflection->invokeArgs($instances);

        return $o;
    }
public function resolveClosure ( \ Closure $ closure ) { $ reflection = new \ ReflectionFunction ( $ closure ) ; $ dependencies = $ reflection -> getParameters ( ) ; $ instances = $ this -> resolveDependencies ( $ dependencies ) ; // Actually resolve the dependencies $ o = $ reflection -> invokeArgs ( $ instances ) ; return $ o ; }
Resolves the dependencies of a function
@param \Closure $closure The closure to resolve
@return mixed Value returned in method
@since 1.0.0
Resolves the dependencies of a function