Skip to content

Commit 9cc7704

Browse files
committed
Change signature of SuccessHandler
1 parent bf75da5 commit 9cc7704

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/Event/Listener/FormSuccessListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function onFormSuccess(FormHandlerEvent $event): void
6363
return;
6464
}
6565

66-
$response = $handler->onSuccess($form->getData(), $event->getFormRequest());
66+
$response = $handler->onSuccess($event->getFormRequest(), $form->getData());
6767

6868
if ($response instanceof Response) {
6969
$event->setResponse($response);

src/FormHandlerSuccessInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ interface FormHandlerSuccessInterface
2222
*
2323
* @param mixed $data The data that is returned from the form
2424
*/
25-
public function onSuccess($data, FormRequest $form): ?Response;
25+
public function onSuccess(FormRequest $form, $data): ?Response;
2626
}

tests/Fixtures/TestFormHandlerWithSuccessHandlerInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function getForm(FormFactoryInterface $factory, Options $options)
2727
/* noop */
2828
}
2929

30-
public function onSuccess($data, FormRequest $form): ?Response
30+
public function onSuccess(FormRequest $form, $data): ?Response
3131
{
3232
return new Response();
3333
}

tests/Fixtures/TestFormHandlerWithSuccessHandlerThrowsExceptionInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function getForm(FormFactoryInterface $factory, Options $options)
2727
/* noop */
2828
}
2929

30-
public function onSuccess($data, FormRequest $form): ?Response
30+
public function onSuccess(FormRequest $form, $data): ?Response
3131
{
3232
throw new \Exception('Invalid call');
3333
}

0 commit comments

Comments
 (0)