Skip to content

Commit

Permalink
Merge pull request #11 from ray-di/prototype
Browse files Browse the repository at this point in the history
Bind shared cache in prototype
  • Loading branch information
koriym authored Nov 10, 2021
2 parents d4c9119 + 9819c56 commit 1383dcb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/LocalCacheProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

use function sys_get_temp_dir;

class LocalCacheProvider implements ProviderInterface
final class LocalCacheProvider implements ProviderInterface
{
/** @var string */
private $cacheDir;
Expand Down
2 changes: 1 addition & 1 deletion src/Psr6MemcachedModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected function configure(): void
$this->bind(CacheItemPoolInterface::class)->annotatedWith(Local::class)->toProvider(LocalCacheProvider::class)->in(Scope::SINGLETON);
$this->bind(CacheItemPoolInterface::class)->annotatedWith(Shared::class)->toConstructor(MemcachedAdapter::class, [
'namespace' => CacheNamespace::class,
])->in(Scope::SINGLETON);
]);
$this->bind()->annotatedWith(MemcacheConfig::class)->toInstance($this->servers);
$this->bind(Memcached::class)->toProvider(MemcachedProvider::class);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Psr6RedisModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected function configure(): void
$this->bind(CacheItemPoolInterface::class)->annotatedWith(Shared::class)->toConstructor(RedisAdapter::class, [
'redis' => RedisInstance::class,
'namespace' => CacheNamespace::class,
])->in(Scope::SINGLETON);
]);
$this->bind()->annotatedWith(RedisConfig::class)->toInstance($this->server);
$this->bind('')->annotatedWith('Ray\PsrCacheModule\Annotation\RedisInstance')->toProvider(RedisProvider::class);
}
Expand Down

0 comments on commit 1383dcb

Please sign in to comment.