public function replay(Request $baseRequest, Notification $notification) { $webHook = $notification->getWebHook(); $endpoint = $webHook->getEndpoint(); $content = json_decode($notification->getContent(), true); $query = array_merge(['username' => $webHook->getUser()->getUsername(), 'endpoint' => $endpoint], $content['query']); $url = $this->router->generate('notifications', $query); $request = Request::create($url, $content['method'], [], [], [], $baseRequest->server->all(), $content['body']); $request->headers->replace($content['headers']); $response = $this->kernel->handle($request, HttpKernelInterface::SUB_REQUEST); return $response; }