protected function resolving(string $id)
    {
        if (isset($this->resolving[$id])) {
            throw new CircularReferenceException($id, $this->resolving);
        }

        // We mark service as being resolved to detect circular references through out the resolution chain.
        $this->resolving[$id] = $id;
    }