Source/Cache/CacheProducer.php
public function produce()
    {
        $cacheFactory = null;
        foreach($this->cacheFactories as $factory)
        {
            if(false === $factory instanceof CacheFactoryInterface) {
                throw new \InvalidArgumentException("Array of Cache Factories must contain valid CacheFactory objects.");
            }
            
            if($this->type == $factory->getType()) {
                $cacheFactory = $factory;
                break;
            }
        }
        
        if(null === $cacheFactory)
        {
            throw ConfigException::cacheFactoryNotFound($this->type);
        }
            
        $cache = $cacheFactory->newInstance($this->app);
        
        if(false === $cache instanceof CacheInterface) {
            throw new \InvalidArgumentException("Cache factory must produce a valid CacheInterface object.");
        }
        
        return $cache;
    }
public function produce()
    {
        $cacheFactory = null;
        foreach($this->cacheFactories as $factory)
        {
            if(false === $factory instanceof CacheFactoryInterface) {
                throw new \InvalidArgumentException("Array of Cache Factories must contain valid CacheFactory objects.");
            }
            
            if($this->type == $factory->getType()) {
                $cacheFactory = $factory;
                break;
            }
        }
        
        if(null === $cacheFactory)
        {
            throw ConfigException::cacheFactoryNotFound($this->type);
        }
            
        $cache = $cacheFactory->newInstance($this->app);
        
        if(false === $cache instanceof CacheInterface) {
            throw new \InvalidArgumentException("Cache factory must produce a valid CacheInterface object.");
        }
        
        return $cache;
    }
public function produce ( ) { $ cacheFactory = null ; foreach ( $ this -> cacheFactories as $ factory ) { if ( false === $ factory instanceof CacheFactoryInterface ) { throw new \ InvalidArgumentException ( "Array of Cache Factories must contain valid CacheFactory objects." ) ; } if ( $ this -> type == $ factory -> getType ( ) ) { $ cacheFactory = $ factory ; break ; } } if ( null === $ cacheFactory ) { throw ConfigException :: cacheFactoryNotFound ( $ this -> type ) ; } $ cache = $ cacheFactory -> newInstance ( $ this -> app ) ; if ( false === $ cache instanceof CacheInterface ) { throw new \ InvalidArgumentException ( "Cache factory must produce a valid CacheInterface object." ) ; } return $ cache ; }
Produces a CacheInterface object.

@return \Affiniti\Config\Cache\CacheInterface

@throws \InvalidArgumentException
@throws \Affiniti\Config\Exception\CacheFactoryNotFound
Produces a CacheInterface object .