src/DoctrineModule/Service/ZendStorageCacheFactory.php
public function createService(ServiceLocatorInterface $sl)
    {
        /** @var $options \DoctrineModule\Options\Cache */
        $options  = $this->getOptions($sl, 'cache');
        $instance = $options->getInstance();

        if (!$instance) {
            // @todo move this validation to the options class
            throw new RuntimeException('ZendStorageCache must have a referenced cache instance');
        }

        $cache = $sl->get($instance);

        if (!$cache instanceof StorageInterface) {
            throw new RuntimeException(
                sprintf(
                    'Retrieved storage "%s" is not a Zend\Cache\Storage\StorageInterface instance, %s found',
                    $instance,
                    is_object($cache) ? get_class($cache) : getType($cache)
                )
            );
        }

        return new ZendStorageCache($cache);
    }
public function createService(ServiceLocatorInterface $sl)
    {
        /** @var $options \DoctrineModule\Options\Cache */
        $options  = $this->getOptions($sl, 'cache');
        $instance = $options->getInstance();

        if (!$instance) {
            // @todo move this validation to the options class
            throw new RuntimeException('ZendStorageCache must have a referenced cache instance');
        }

        $cache = $sl->get($instance);

        if (!$cache instanceof StorageInterface) {
            throw new RuntimeException(
                sprintf(
                    'Retrieved storage "%s" is not a Zend\Cache\Storage\StorageInterface instance, %s found',
                    $instance,
                    is_object($cache) ? get_class($cache) : getType($cache)
                )
            );
        }

        return new ZendStorageCache($cache);
    }
{@inheritDoc}
@return ZendStorageCache
@throws RuntimeException