/** * {@inheritDoc} */ public function extract(HandlerInterface $handler) { $cacheKey = $this->generateCacheKey($handler); $handlerDoc = $this->cache->get($cacheKey); if (!$handlerDoc) { $handlerDoc = $this->delegate->extract($handler); $this->cache->set($cacheKey, $handlerDoc); } return $handlerDoc; }
/** * {@inheritDoc} */ public function loadActions() { $actions = $this->cache->get($this->key); if ($actions) { return $actions; } $actions = $this->loader->loadActions(); $this->cache->set($this->key, $actions); return $actions; }
/** * {@inheritDoc} */ public function loadMetadata($class) { if (is_object($class)) { $class = get_class($class); } $key = 'model_transformer.annotated:' . $class; $metadata = $this->cache->get($key); if (null === $metadata) { $metadata = $this->delegate->loadMetadata($class); $this->cache->set($key, $metadata); } return $metadata; }
/** * Test check exists in cache, and entry not exists in storage */ public function testHasInStorageAndNotExists() { $this->cache1->expects($this->once())->method('has')->with('bar')->willReturn(false); $this->cache2->expects($this->once())->method('has')->with('bar')->willReturn(false); $data = $this->cache->has('bar'); $this->assertFalse($data); }
/** * {@inheritDoc} */ public function delete($id) { return $this->cache->remove($id); }
/** * {@inheritDoc} */ public function fetch($key) { return $this->cache->get($key); }
/** * {@inheritDoc} */ public function clear($cacheDir) { $this->cache->cleanup(); }