public function resolve(string $name, ...$args)
    {
        //if we can't resolve it
        if (!$this->canResolve($name)) {
            throw ResolverException::forResolverNotFound($name);
        }

        //is it registered ?
        if ($this->isRegistered($name)) {
            $callback = $this->registry[$name];
            return call_user_func_array($callback, $args);
        }

        //if class exist
        if (class_exists($name)) {
            //it is a class, let's register this
            $this->register($name, function (...$args) use ($name) {
                //if the static method i exists
                if (method_exists($name, 'i')) {
                    //instantiate it
                    return forward_static_call_array([$name, 'i'], $args);
                }

                return new $name(...$args);
            });

            //then resolve this
            return $this->resolve($name, ...$args);
        }

        //its callable, let's register this
        $this->register($name, function (...$args) use ($name) {
            return call_user_func_array($name, $args);
        });

        //then resolve this
        return $this->resolve($name, ...$args);
    }
public function resolve(string $name, ...$args)
    {
        //if we can't resolve it
        if (!$this->canResolve($name)) {
            throw ResolverException::forResolverNotFound($name);
        }

        //is it registered ?
        if ($this->isRegistered($name)) {
            $callback = $this->registry[$name];
            return call_user_func_array($callback, $args);
        }

        //if class exist
        if (class_exists($name)) {
            //it is a class, let's register this
            $this->register($name, function (...$args) use ($name) {
                //if the static method i exists
                if (method_exists($name, 'i')) {
                    //instantiate it
                    return forward_static_call_array([$name, 'i'], $args);
                }

                return new $name(...$args);
            });

            //then resolve this
            return $this->resolve($name, ...$args);
        }

        //its callable, let's register this
        $this->register($name, function (...$args) use ($name) {
            return call_user_func_array($name, $args);
        });

        //then resolve this
        return $this->resolve($name, ...$args);
    }
public function resolve ( string $ name , ... $ args ) { //if we can't resolve it if ( ! $ this -> canResolve ( $ name ) ) { throw ResolverException :: forResolverNotFound ( $ name ) ; } //is it registered ? if ( $ this -> isRegistered ( $ name ) ) { $ callback = $ this -> registry [ $ name ] ; return call_user_func_array ( $ callback , $ args ) ; } //if class exist if ( class_exists ( $ name ) ) { //it is a class, let's register this $ this -> register ( $ name , function ( ... $ args ) use ( $ name ) { //if the static method i exists if ( method_exists ( $ name , 'i' ) ) { //instantiate it return forward_static_call_array ( [ $ name , 'i' ] , $ args ) ; } return new $ name ( ... $ args ) ; } ) ; //then resolve this return $ this -> resolve ( $ name , ... $ args ) ; } //its callable, let's register this $ this -> register ( $ name , function ( ... $ args ) use ( $ name ) { return call_user_func_array ( $ name , $ args ) ; } ) ; //then resolve this return $ this -> resolve ( $ name , ... $ args ) ; }
Does the resolving

@param *string $name Name of Resolver
@param *mixed  $args What to execute when we need resolving

@return mixed
Does the resolving