protected function wrapService(string $name, ?array $parameters = null)
    {
        $config = $this->config->get($name);
        if (true === $config['wrap']) {
            $that = $this;

            return function () use ($that, $name, $parameters) {
                return $that->autoWireClass($name, $parameters);
            };
        }

        return $this->autoWireClass($name, $parameters);
    }