src/Viserio/Component/Container/Container.php
public function register(ServiceProviderInterface $provider, array $parameters = []): ContainerContract
    {
        foreach ($provider->getFactories() as $key => $callable) {
            $this->singleton($key, static function ($container) use ($callable) {
                return $callable($container, null);
            });
        }

        foreach ($provider->getExtensions() as $key => $callable) {
            if ($this->has($key)) {
                $this->extend($key, static function ($previous, $container) use ($callable) {
                    // Extend a previous entry
                    return $callable($container, $previous);
                });
            } else {
                $this->singleton($key, static function ($container) use ($callable) {
                    return $callable($container, null);
                });
            }
        }

        foreach ($parameters as $key => $value) {
            $this->instance($key, $value);
        }

        return $this;
    }
public function register(ServiceProviderInterface $provider, array $parameters = []): ContainerContract
    {
        foreach ($provider->getFactories() as $key => $callable) {
            $this->singleton($key, static function ($container) use ($callable) {
                return $callable($container, null);
            });
        }

        foreach ($provider->getExtensions() as $key => $callable) {
            if ($this->has($key)) {
                $this->extend($key, static function ($previous, $container) use ($callable) {
                    // Extend a previous entry
                    return $callable($container, $previous);
                });
            } else {
                $this->singleton($key, static function ($container) use ($callable) {
                    return $callable($container, null);
                });
            }
        }

        foreach ($parameters as $key => $value) {
            $this->instance($key, $value);
        }

        return $this;
    }
{@inheritdoc}