File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -90,9 +90,10 @@ public function registerHandler(FormHandlerInterface $handler): void
9090
9191 /**
9292 * @param string|FormHandlerInterface $class
93- * @param mixed[] $options
93+ * @param array< mixed> $options
9494 *
9595 * @return FormRequest
96+ * @throws \Exception
9697 */
9798 public function handle ($ class , array $ options = []): FormRequest
9899 {
@@ -113,11 +114,11 @@ public function handle($class, array $options = []): FormRequest
113114
114115 $ form ->handleRequest ($ this ->request );
115116
116- if ($ handler instanceof FormHandlerResponseInterface) {
117- $ formRequest ->setResponse ($ handler ->getResponse ($ formRequest ));
118- }
119-
120117 if (!$ form ->isSubmitted ()) {
118+ if ($ handler instanceof FormHandlerResponseInterface) {
119+ $ formRequest ->setResponse ($ handler ->getResponse ($ formRequest ));
120+ }
121+
121122 return $ formRequest ;
122123 }
123124
@@ -131,6 +132,8 @@ public function handle($class, array $options = []): FormRequest
131132
132133 if ($ response = $ event ->getResponse ()) {
133134 $ formRequest ->setResponse ($ response );
135+ } else if ($ handler instanceof FormHandlerResponseInterface) {
136+ $ formRequest ->setResponse ($ handler ->getResponse ($ formRequest ));
134137 }
135138
136139 return $ formRequest ;
You can’t perform that action at this time.
0 commit comments