public function provide($name, $args)
    {
        $services = $this->getServices();
        if (isset($services[$name])) {
            return (new Service($name, $services[$name]))
                ->resolve($args, $this->getDi());
        } else {
            $method = self::METHOD_PREFIX . $name;
            if (method_exists($this, $method)) {
                if (empty($args)) {
                    return $this->$method();
                } else {
                    return call_user_func_array([$this, $method], $args);
                }
            } else {
                throw new Exception("Cannot load '{$name}' from " . get_class($this));
            }
        }
    }
public function provide($name, $args)
    {
        $services = $this->getServices();
        if (isset($services[$name])) {
            return (new Service($name, $services[$name]))
                ->resolve($args, $this->getDi());
        } else {
            $method = self::METHOD_PREFIX . $name;
            if (method_exists($this, $method)) {
                if (empty($args)) {
                    return $this->$method();
                } else {
                    return call_user_func_array([$this, $method], $args);
                }
            } else {
                throw new Exception("Cannot load '{$name}' from " . get_class($this));
            }
        }
    }
public function provide ( $ name , $ args ) { $ services = $ this -> getServices ( ) ; if ( isset ( $ services [ $ name ] ) ) { return ( new Service ( $ name , $ services [ $ name ] ) ) -> resolve ( $ args , $ this -> getDi ( ) ) ; } else { $ method = self :: METHOD_PREFIX . $ name ; if ( method_exists ( $ this , $ method ) ) { if ( empty ( $ args ) ) { return $ this -> $ method ( ) ; } else { return call_user_func_array ( [ $ this , $ method ] , $ args ) ; } } else { throw new Exception ( "Cannot load '{$name}' from " . get_class ( $ this ) ) ; } } }
Creates service instance

@param string $name service name
@param array $args arguments to create instance
Creates service instance