Skip to content

Commit c6c3137

Browse files
authored
Make sure we always dealing with ta tagging cache pool (#57)
1 parent 3fac606 commit c6c3137

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

src/Cache/RecordingCachePool.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Cache\CacheBundle\Cache;
1313

1414
use Cache\Taggable\TaggablePoolInterface;
15+
use Cache\Taggable\TaggablePSR6PoolAdapter;
1516
use Psr\Cache\CacheItemInterface;
1617
use Psr\Cache\CacheItemPoolInterface;
1718

@@ -37,7 +38,7 @@ class RecordingCachePool implements CacheItemPoolInterface, TaggablePoolInterfac
3738
*/
3839
public function __construct(CacheItemPoolInterface $cachePool)
3940
{
40-
$this->cachePool = $cachePool;
41+
$this->cachePool = TaggablePSR6PoolAdapter::makeTaggable($cachePool);
4142
}
4243

4344
/**

src/Factory/DoctrineBridgeFactory.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Cache\Bridge\DoctrineCacheBridge;
1515
use Cache\CacheBundle\Cache\FixedTaggingCachePool;
16+
use Cache\Taggable\TaggablePSR6PoolAdapter;
1617
use Psr\Cache\CacheItemPoolInterface;
1718

1819
/**
@@ -30,7 +31,7 @@ class DoctrineBridgeFactory
3031
public static function get(CacheItemPoolInterface $pool, $config, array $tags)
3132
{
3233
if ($config['use_tagging']) {
33-
$pool = new FixedTaggingCachePool($pool, $tags);
34+
$pool = new FixedTaggingCachePool(TaggablePSR6PoolAdapter::makeTaggable($pool), $tags);
3435
}
3536

3637
return new DoctrineCacheBridge($pool);

src/Factory/SessionHandlerFactory.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Cache\CacheBundle\Cache\FixedTaggingCachePool;
1515
use Cache\SessionHandler\Psr6SessionHandler;
16+
use Cache\Taggable\TaggablePSR6PoolAdapter;
1617
use Psr\Cache\CacheItemPoolInterface;
1718

1819
/**
@@ -29,7 +30,7 @@ class SessionHandlerFactory
2930
public static function get(CacheItemPoolInterface $pool, $config)
3031
{
3132
if ($config['use_tagging']) {
32-
$pool = new FixedTaggingCachePool($pool, ['session']);
33+
$pool = new FixedTaggingCachePool(TaggablePSR6PoolAdapter::makeTaggable($pool), ['session']);
3334
}
3435

3536
return new Psr6SessionHandler($pool, $config);

src/Factory/ValidationFactory.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Cache\CacheBundle\Bridge\SymfonyValidatorBridge;
1515
use Cache\CacheBundle\Cache\FixedTaggingCachePool;
16+
use Cache\Taggable\TaggablePSR6PoolAdapter;
1617
use Psr\Cache\CacheItemPoolInterface;
1718

1819
/**
@@ -29,7 +30,7 @@ class ValidationFactory
2930
public static function get(CacheItemPoolInterface $pool, $config)
3031
{
3132
if ($config['use_tagging']) {
32-
$pool = new FixedTaggingCachePool($pool, ['validation']);
33+
$pool = new FixedTaggingCachePool(TaggablePSR6PoolAdapter::makeTaggable($pool), ['validation']);
3334
}
3435

3536
return new SymfonyValidatorBridge($pool);

0 commit comments

Comments
 (0)