public function resolve(string $serviceName, Container $container) : array
    {
        if (!isset($this->services[$serviceName]))
        {
            throw new UnknownServiceException('The service provider "' . get_class($this) . '" does not support service resolving of the service "' . $serviceName . '"');
        }

        $serviceConfiguration = $this->services[$serviceName];

        // create the factory 
        $factory = ServiceFactory::fromArray($serviceConfiguration);

        // resolve the service 
        $service = $factory->create($container);

        // if the service is not shared skip the store
        if ((!isset($serviceConfiguration['shared'])) || $serviceConfiguration['shared'] !== false)
        {
            return [$service, true];
        }

        return [$service, false];
    }