src/Container.php
protected function append(Argument $argument, string $serviceId, int $containerId): void
    {
        $returnType = $argument->getReturnType();

        $overridden = false;
        if (isset($this->decorators[$serviceId])) {
            if ($this->list[$serviceId]->isDecorator() && $argument->isDecorator()) {
                throw new \InvalidArgumentException('Cannot add two or more decorators for one service.');
            }
            $decoratorId = $this->decorators[$serviceId];
            $this->overridden[$serviceId] = [$containerId, $decoratorId, $this->ids[$serviceId]];
            $serviceId .= 'Original';
            $overridden = true;
        }

        if ($argument->isDecorator()) {
            $decoratedService = $argument->getDecoratedService();
            if (isset($this->list[$decoratedService])) {
                $this->overridden[$decoratedService] = [$this->ids[$decoratedService], $serviceId, $containerId];
                $this->replace($decoratedService, $decoratedService . 'Original');
            }
            $this->decorators[$decoratedService] = $serviceId;
            $serviceId = $decoratedService;
        }

        $this->list[$serviceId] = $argument;
        $this->ids[$serviceId] = $containerId;
        if (!$overridden) {
            $this->map[$returnType][] = $serviceId;
        }
    }
protected function append(Argument $argument, string $serviceId, int $containerId): void
    {
        $returnType = $argument->getReturnType();

        $overridden = false;
        if (isset($this->decorators[$serviceId])) {
            if ($this->list[$serviceId]->isDecorator() && $argument->isDecorator()) {
                throw new \InvalidArgumentException('Cannot add two or more decorators for one service.');
            }
            $decoratorId = $this->decorators[$serviceId];
            $this->overridden[$serviceId] = [$containerId, $decoratorId, $this->ids[$serviceId]];
            $serviceId .= 'Original';
            $overridden = true;
        }

        if ($argument->isDecorator()) {
            $decoratedService = $argument->getDecoratedService();
            if (isset($this->list[$decoratedService])) {
                $this->overridden[$decoratedService] = [$this->ids[$decoratedService], $serviceId, $containerId];
                $this->replace($decoratedService, $decoratedService . 'Original');
            }
            $this->decorators[$decoratedService] = $serviceId;
            $serviceId = $decoratedService;
        }

        $this->list[$serviceId] = $argument;
        $this->ids[$serviceId] = $containerId;
        if (!$overridden) {
            $this->map[$returnType][] = $serviceId;
        }
    }
@param Argument $argument
@param string $serviceId
@param int $containerId

@return void