1111
1212namespace Cache \Taggable ;
1313
14- use Cache \Taggable \TaggableItemInterface ;
15- use Cache \Taggable \TaggablePoolInterface ;
16- use Cache \Taggable \TaggablePoolTrait ;
1714use Psr \Cache \CacheItemInterface ;
1815use Psr \Cache \CacheItemPoolInterface ;
1916
@@ -67,14 +64,14 @@ private function __construct(CacheItemPoolInterface $cachePool, CacheItemPoolInt
6764 }
6865
6966 /**
70- * @param CacheItemPoolInterface $cachePool The pool to which to add tagging capabilities.
67+ * @param CacheItemPoolInterface $cachePool The pool to which to add tagging capabilities.
7168 * @param CacheItemPoolInterface|null $tagStorePool The pool to store tags in. If null is passed, the main pool is used.
7269 *
7370 * @return TaggablePoolInterface
7471 */
7572 public static function makeTaggable (CacheItemPoolInterface $ cachePool , CacheItemPoolInterface $ tagStorePool = null )
7673 {
77- if ($ cachePool instanceOf TaggablePoolInterface && $ tagStorePool === null ) {
74+ if ($ cachePool instanceof TaggablePoolInterface && $ tagStorePool === null ) {
7875 return $ cachePool ;
7976 }
8077
@@ -92,7 +89,7 @@ public function getItem($key)
9289 /**
9390 * {@inheritdoc}
9491 */
95- public function getItems (array $ keys = array () )
92+ public function getItems (array $ keys = [] )
9693 {
9794 $ items = $ this ->cachePool ->getItems ($ keys );
9895
@@ -118,6 +115,7 @@ public function hasItem($key)
118115 public function clear ()
119116 {
120117 $ ret = $ this ->cachePool ->clear ();
118+
121119 return $ this ->tagStorePool ->clear () && $ ret ; // Is this acceptable?
122120 }
123121
@@ -127,6 +125,7 @@ public function clear()
127125 public function deleteItem ($ key )
128126 {
129127 $ this ->preRemoveItem ($ key );
128+
130129 return $ this ->cachePool ->deleteItem ($ key );
131130 }
132131
@@ -148,6 +147,7 @@ public function deleteItems(array $keys)
148147 public function save (CacheItemInterface $ item )
149148 {
150149 $ this ->saveTags ($ item );
150+
151151 return $ this ->cachePool ->save ($ item ->unwrap ());
152152 }
153153
@@ -157,6 +157,7 @@ public function save(CacheItemInterface $item)
157157 public function saveDeferred (CacheItemInterface $ item )
158158 {
159159 $ this ->saveTags ($ item );
160+
160161 return $ this ->cachePool ->saveDeferred ($ item ->unwrap ());
161162 }
162163
0 commit comments