Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jan 16, 2020
1 parent 9831c74 commit 0a70beb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
16 changes: 10 additions & 6 deletions src/Illuminate/Cache/CacheManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}

/**
Expand Down
18 changes: 9 additions & 9 deletions src/Illuminate/Cache/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit 0a70beb

Please sign in to comment.