2 namespace Consolidation\AnnotatedCommand\Cache;
5 * Make a generic cache object conform to our expected interface.
7 class CacheWrapper implements SimpleCacheInterface
11 public function __construct($dataStore)
13 $this->dataStore = $dataStore;
17 * Test for an entry from the cache
21 public function has($key)
23 if (method_exists($this->dataStore, 'has')) {
24 return $this->dataStore->has($key);
26 $test = $this->dataStore->get($key);
31 * Get an entry from the cache
35 public function get($key)
37 return (array) $this->dataStore->get($key);
41 * Store an entry in the cache
45 public function set($key, $data)
47 $this->dataStore->set($key, $data);