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];
    }
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];
    }
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 ] ; }
Resolve a service with the given name

@param string                    $serviceName
@param Container                 $container
@return array[mixed, bool]
Resolve a service with the given name