Cache\Taggable\TaggablePSR6PoolAdapter::makeTaggable PHP Method

makeTaggable() public static method

public static makeTaggable ( Psr\Cache\CacheItemPoolInterface $cachePool, Psr\Cache\CacheItemPoolInterface $tagStorePool = null ) : Cache\Taggable\TaggablePoolInterface
$cachePool Psr\Cache\CacheItemPoolInterface The pool to which to add tagging capabilities.
$tagStorePool Psr\Cache\CacheItemPoolInterface The pool to store tags in. If null is passed, the main pool is used.
return Cache\Taggable\TaggablePoolInterface
    public static function makeTaggable(CacheItemPoolInterface $cachePool, CacheItemPoolInterface $tagStorePool = null)
    {
        if ($cachePool instanceof TaggablePoolInterface && $tagStorePool === null) {
            return $cachePool;
        }
        return new self($cachePool, $tagStorePool);
    }

Usage Example

 /**
  * @param CacheItemPoolInterface $pool
  * @param array                  $config
  *
  * @return Psr6SessionHandler
  */
 public static function get(CacheItemPoolInterface $pool, $config)
 {
     if ($config['use_tagging']) {
         $pool = new FixedTaggingCachePool(TaggablePSR6PoolAdapter::makeTaggable($pool), ['session']);
     }
     return new Psr6SessionHandler($pool, $config);
 }
All Usage Examples Of Cache\Taggable\TaggablePSR6PoolAdapter::makeTaggable