Skip to content
Permalink
Browse files

formatting

  • Loading branch information
taylorotwell committed Jan 16, 2020
1 parent 9831c74 commit 0a70bebd5ecfd51185a312bbfb60ee7f8ff7eb09
Showing with 19 additions and 15 deletions.
  1. +10 −6 src/Illuminate/Cache/CacheManager.php
  2. +9 −9 src/Illuminate/Cache/Repository.php
@@ -259,14 +259,17 @@ protected function createDynamodbDriver(array $config)
public function repository(Store $store)
{
return tap(new Repository($store), function ($repository) {
$this->addEventDispatcher($repository);
$this->setEventDispatcher($repository);
});
}

/**
* @param Repository $repository
* Set the event dispatcher on the given repository instance.
*
* @param \Illuminate\Cache\Repository $repository
* @return void
*/
protected function addEventDispatcher(Repository $repository)
protected function setEventDispatcher(Repository $repository)
{
if (! $this->app->bound(DispatcherContract::class)) {
return;
@@ -278,12 +281,13 @@ protected function addEventDispatcher(Repository $repository)
}

/**
* Refreshes the event dispatcher of all resolved repositories
* with the currently bound event dispatcher implementation.
* Re-set the event dispatcher on all resolved cache repositories.
*
* @return void
*/
public function refreshEventDispatcher()
{
array_map([$this, 'addEventDispatcher'], $this->stores);
array_map([$this, 'setEventDispatcher'], $this->stores);
}

/**
@@ -548,24 +548,24 @@ protected function event($event)
}

/**
* Set the event dispatcher instance.
* Get the event dispatcher instance.
*
* @param \Illuminate\Contracts\Events\Dispatcher $events
* @return void
* @return \Illuminate\Contracts\Events\Dispatcher
*/
public function setEventDispatcher(Dispatcher $events)
public function getEventDispatcher()
{
$this->events = $events;
return $this->events;
}

/**
* Get the event dispatcher instance.
* Set the event dispatcher instance.
*
* @return \Illuminate\Contracts\Events\Dispatcher $events
* @param \Illuminate\Contracts\Events\Dispatcher $events
* @return void
*/
public function getEventDispatcher()
public function setEventDispatcher(Dispatcher $events)
{
return $this->events;
$this->events = $events;
}

/**

0 comments on commit 0a70beb

Please sign in to comment.
You can’t perform that action at this time.