src/Resolver/Factory/FactoryResolver.php
public function getService(string $key, ServiceLocatorInterface $serviceLocator, array $extra = null): object
    {
        $factory = $this->getFactories()[$key];
        if (is_string($factory) === true) {
            $factory = new $factory();
            $this->factories[$key] = $factory;
        }

        try {
            return $factory->createService($key, $serviceLocator, $extra);
        } catch (Throwable $exception) {
            throw new ServiceCreateFailed($key, $exception);
        }
    }
public function getService(string $key, ServiceLocatorInterface $serviceLocator, array $extra = null): object
    {
        $factory = $this->getFactories()[$key];
        if (is_string($factory) === true) {
            $factory = new $factory();
            $this->factories[$key] = $factory;
        }

        try {
            return $factory->createService($key, $serviceLocator, $extra);
        } catch (Throwable $exception) {
            throw new ServiceCreateFailed($key, $exception);
        }
    }
public function getService ( string $ key , ServiceLocatorInterface $ serviceLocator , array $ extra = null ) : object { $ factory = $ this -> getFactories ( ) [ $ key ] ; if ( is_string ( $ factory ) === true ) { $ factory = new $ factory ( ) ; $ this -> factories [ $ key ] = $ factory ; } try { return $ factory -> createService ( $ key , $ serviceLocator , $ extra ) ; } catch ( Throwable $ exception ) { throw new ServiceCreateFailed ( $ key , $ exception ) ; } }
When the factory is a string, a new instance will be created and replaces the string.

@inheritDoc
When the factory is a string a new instance will be created and replaces the string .