|
21 | 21 | use React\Promise\FulfilledPromise; |
22 | 22 | use React\Promise\PromiseInterface; |
23 | 23 | use RingCentral\Psr7\Response as Psr7Response; |
24 | | -use Symfony\Component\EventDispatcher\EventDispatcherInterface; |
25 | 24 | use Symfony\Component\HttpFoundation\Exception\RequestExceptionInterface; |
26 | 25 | use Symfony\Component\HttpFoundation\Request; |
27 | 26 | use Symfony\Component\HttpFoundation\RequestStack; |
|
42 | 41 | use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; |
43 | 42 | use Symfony\Component\HttpKernel\HttpKernel; |
44 | 43 | use Symfony\Component\HttpKernel\KernelEvents; |
| 44 | +use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; |
45 | 45 | use Throwable; |
46 | 46 |
|
47 | 47 | /** |
@@ -101,7 +101,7 @@ public function preload(): PromiseInterface |
101 | 101 | { |
102 | 102 | return $this |
103 | 103 | ->dispatcher |
104 | | - ->asyncDispatch(AsyncKernelEvents::PRELOAD, new PreloadEvent()); |
| 104 | + ->asyncDispatch(new PreloadEvent(), AsyncKernelEvents::PRELOAD); |
105 | 105 | } |
106 | 106 |
|
107 | 107 | /** |
@@ -144,7 +144,7 @@ private function handleAsyncRaw(Request $request): PromiseInterface |
144 | 144 | $event = new RequestEvent($this, $request, $type); |
145 | 145 |
|
146 | 146 | return $dispatcher |
147 | | - ->asyncDispatch(KernelEvents::REQUEST, $event) |
| 147 | + ->asyncDispatch($event, KernelEvents::REQUEST) |
148 | 148 | ->then(function (RequestEvent $event) use ($request, $type) { |
149 | 149 | return $event->hasResponse() |
150 | 150 | ? $this->filterResponsePromise( |
@@ -225,7 +225,7 @@ private function callAsyncView( |
225 | 225 |
|
226 | 226 | return $this |
227 | 227 | ->dispatcher |
228 | | - ->asyncDispatch(KernelEvents::VIEW, $event) |
| 228 | + ->asyncDispatch($event, KernelEvents::VIEW) |
229 | 229 | ->then(function (ViewEvent $event) use ($controller, $response) { |
230 | 230 | if ($event->hasResponse()) { |
231 | 231 | return $event->getResponse(); |
@@ -259,7 +259,7 @@ private function filterResponsePromise(Response $response, Request $request, int |
259 | 259 |
|
260 | 260 | return $this |
261 | 261 | ->dispatcher |
262 | | - ->asyncDispatch(KernelEvents::RESPONSE, $event) |
| 262 | + ->asyncDispatch($event, KernelEvents::RESPONSE) |
263 | 263 | ->then(function (ResponseEvent $event) use ($request, $type) { |
264 | 264 | $this->finishRequestPromise($request, $type); |
265 | 265 |
|
@@ -310,7 +310,7 @@ private function handleExceptionPromise( |
310 | 310 |
|
311 | 311 | return $this |
312 | 312 | ->dispatcher |
313 | | - ->asyncDispatch(KernelEvents::EXCEPTION, $event) |
| 313 | + ->asyncDispatch($event, KernelEvents::EXCEPTION) |
314 | 314 | ->then(function (ExceptionEvent $event) use ($request, $type) { |
315 | 315 | // Supporting both 4.3 and 5.0 |
316 | 316 | $throwable = ($event instanceof GetResponseForExceptionEvent) |
|
0 commit comments