src/Bridges/LeagueContainerDecorator.php
public function addServiceProvider($provider)
    {
        if ($provider instanceof ServiceProviderInterface) {
            foreach ($provider->getServices() as $key => $callable) {
                if (!$this->container->hasShared($key)) {
                    $this->container->share($key, function () use ($callable) {
                        return $callable($this);
                    });
                } else {
                    $previous = $this->container->get($key);
                    $this->container->share($key, function () use ($callable, $previous) {
                        return $callable($this, function () use ($previous) {
                            return $previous;
                        });
                    });
                }
            }
        } else {
            $this->container->addServiceProvider($provider);
        }

        return $this;
    }
public function addServiceProvider($provider)
    {
        if ($provider instanceof ServiceProviderInterface) {
            foreach ($provider->getServices() as $key => $callable) {
                if (!$this->container->hasShared($key)) {
                    $this->container->share($key, function () use ($callable) {
                        return $callable($this);
                    });
                } else {
                    $previous = $this->container->get($key);
                    $this->container->share($key, function () use ($callable, $previous) {
                        return $callable($this, function () use ($previous) {
                            return $previous;
                        });
                    });
                }
            }
        } else {
            $this->container->addServiceProvider($provider);
        }

        return $this;
    }
@param ServiceProviderInterface|\League\Container\ServiceProvider\ServiceProviderInterface|string $provider

@return $this