Layton/Struct/DependentStruct.php
public function injectionByClosure($closure, $method, $inherentParams=[])
    {
        if (! ($closure instanceof \Closure)) {
            throw new \InvalidArgumentException('Method 0 must be a Closure.');
        }
        $instances = $this->dependentService->getParams($this->reflection, $method, count($inherentParams));
        $params = array_merge($instances, $inherentParams);
        return call_user_func_array($closure, $params);
    }
public function injectionByClosure($closure, $method, $inherentParams=[])
    {
        if (! ($closure instanceof \Closure)) {
            throw new \InvalidArgumentException('Method 0 must be a Closure.');
        }
        $instances = $this->dependentService->getParams($this->reflection, $method, count($inherentParams));
        $params = array_merge($instances, $inherentParams);
        return call_user_func_array($closure, $params);
    }
public function injectionByClosure ( $ closure , $ method , $ inherentParams = [ ] ) { if ( ! ( $ closure instanceof \ Closure ) ) { throw new \ InvalidArgumentException ( 'Method 0 must be a Closure.' ) ; } $ instances = $ this -> dependentService -> getParams ( $ this -> reflection , $ method , count ( $ inherentParams ) ) ; $ params = array_merge ( $ instances , $ inherentParams ) ; return call_user_func_array ( $ closure , $ params ) ; }
Injection a Closure

@param \Closure $closure
@param string $method
@param array $inherentParams

@return mixed

@throws \InvalidArgumentException
Injection a Closure