Skip to content

Commit

Permalink
Merge pull request #380 from CandoImage/fix-event-dispatcher
Browse files Browse the repository at this point in the history
Fix event dispatcher arguments order
  • Loading branch information
weisswurstkanone authored Jun 22, 2021
2 parents 4c79ae3 + 967bd98 commit f53fa4f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Service/OutputCacheService.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function save(Request $request, JsonResponse $response, $extraTags = []):
$extraTags = array_merge(['output', 'datahub', $clientname], $extraTags);

$event = new OutputCachePreSaveEvent($request, $response);
$this->eventDispatcher->dispatch(OutputCacheEvents::PRE_SAVE, $event);
$this->eventDispatcher->dispatch($event, OutputCacheEvents::PRE_SAVE);

$this->saveToCache($cacheKey, $event->getResponse(), $extraTags);
}
Expand Down Expand Up @@ -134,7 +134,7 @@ private function useCache(Request $request): bool

// So far, cache will be used, unless the listener denies it
$event = new OutputCachePreLoadEvent($request, true);
$this->eventDispatcher->dispatch(OutputCacheEvents::PRE_LOAD, $event);
$this->eventDispatcher->dispatch($event, OutputCacheEvents::PRE_LOAD);

return $event->isUseCache();
}
Expand Down

0 comments on commit f53fa4f

Please sign in to comment.