src/Leevel/Di/Container.php
public function remove(string $name): void
    {
        $name = $this->normalize($name);

        $prop = [
            'services',
            'instances',
            'singletons',
        ];

        foreach ($prop as $item) {
            if (isset($this->{$item}[$name])) {
                unset($this->{$item}[$name]);
            }
        }

        if ($this->existsCoroutine($name)) {
            unset($this->coroutineInstances[$this->coroutineUid()][$name]);
        }
    }
public function remove(string $name): void
    {
        $name = $this->normalize($name);

        $prop = [
            'services',
            'instances',
            'singletons',
        ];

        foreach ($prop as $item) {
            if (isset($this->{$item}[$name])) {
                unset($this->{$item}[$name]);
            }
        }

        if ($this->existsCoroutine($name)) {
            unset($this->coroutineInstances[$this->coroutineUid()][$name]);
        }
    }
删除服务和实例.

@param string $name