Skip to content

Commit

Permalink
Inject optional EventDispatcher into CacheManager (#1157)
Browse files Browse the repository at this point in the history
  • Loading branch information
MartkCz authored and roxblnfk committed Oct 22, 2024
1 parent 6f4b38a commit 80bd39f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Cache/src/Bootloader/CacheBootloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Spiral\Cache\Bootloader;

use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\SimpleCache\CacheInterface;
use Spiral\Boot\Bootloader\Bootloader;
use Spiral\Boot\DirectoriesInterface;
Expand Down Expand Up @@ -49,9 +50,10 @@ public function init(BinderInterface $binder, EnvironmentInterface $env, Directo
private function initCacheManager(
BinderInterface $binder,
FactoryInterface $factory,
CacheConfig $config
CacheConfig $config,
?EventDispatcherInterface $dispatcher = null
): CacheManager {
$manager = new CacheManager($config, $factory);
$manager = new CacheManager($config, $factory, $dispatcher);

foreach ($config->getAliases() as $alias => $storageName) {
$binder->bind(
Expand Down

0 comments on commit 80bd39f

Please sign in to comment.