From 967bd98b832cb43a1a89f01c811a036a1fcb49d3 Mon Sep 17 00:00:00 2001 From: a_pleisch Date: Mon, 21 Jun 2021 11:00:01 +0200 Subject: [PATCH] Fix event dispatcher arguments order --- src/Service/OutputCacheService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Service/OutputCacheService.php b/src/Service/OutputCacheService.php index cda51920..13ddf223 100644 --- a/src/Service/OutputCacheService.php +++ b/src/Service/OutputCacheService.php @@ -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); } @@ -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(); }