Skip to content

Commit

Permalink
Fix event dispatcher arguments order
Browse files Browse the repository at this point in the history
  • Loading branch information
mugge6 committed Jun 21, 2021
1 parent 4c79ae3 commit 967bd98
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 967bd98

Please sign in to comment.