public function call()
    {
        $args = func_get_args();
        $service = array_shift($args);
        if (!is_array($service)) {
            throw new \RuntimeException("Expected an array");
        }
        if (!is_callable($service[0])) {
            throw new \InvalidArgumentException("Can not use service '{$service[0]}' as a function, it is not callable");
        }

        // if the service needs the container, it is specified in the decl() call as the second param:
        if ($service[1]) {
            array_unshift($args, $this);
        }
        return call_user_func_array($service[0], $args);
    }
public function call()
    {
        $args = func_get_args();
        $service = array_shift($args);
        if (!is_array($service)) {
            throw new \RuntimeException("Expected an array");
        }
        if (!is_callable($service[0])) {
            throw new \InvalidArgumentException("Can not use service '{$service[0]}' as a function, it is not callable");
        }

        // if the service needs the container, it is specified in the decl() call as the second param:
        if ($service[1]) {
            array_unshift($args, $this);
        }
        return call_user_func_array($service[0], $args);
    }
public function call ( ) { $ args = func_get_args ( ) ; $ service = array_shift ( $ args ) ; if ( ! is_array ( $ service ) ) { throw new \ RuntimeException ( "Expected an array" ) ; } if ( ! is_callable ( $ service [ 0 ] ) ) { throw new \ InvalidArgumentException ( "Can not use service '{$service[0]}' as a function, it is not callable" ) ; } // if the service needs the container, it is specified in the decl() call as the second param: if ( $ service [ 1 ] ) { array_unshift ( $ args , $ this ) ; } return call_user_func_array ( $ service [ 0 ] , $ args ) ; }
Separate helper for calling a service as a function.

@return mixed

@throws \InvalidArgumentException
Separate helper for calling a service as a function .