コード例 #1
0
 /**
  * {@inheritdoc}
  *
  * @throws CacheException
  */
 public function createInjection(\ReflectionClass $class, $context = null)
 {
     if (isset($this->stores[$class->getName()])) {
         return $this->stores[$class->getName()];
     }
     if (!$class->isInstantiable()) {
         //Default store
         return $this->store();
     }
     if (!$this->config->hasStore($class->getName())) {
         throw new CacheException("Unable construct cache store '{$class}', no options found.");
     }
     return $this->store($class->getName());
 }
コード例 #2
0
ファイル: CacheManager.php プロジェクト: spiral/components
 /**
  * {@inheritdoc}
  *
  * @throws CacheException
  */
 public function createInjection(\ReflectionClass $class, $context = null)
 {
     return $this->store($this->config->detectStore($class));
 }