|
12 | 12 | use Symfony\Component\Form\FormInterface; |
13 | 13 | use Symfony\Component\HttpFoundation\Response; |
14 | 14 |
|
15 | | -class FormActionEvent extends FormEvent |
| 15 | +final class FormActionEvent extends FormEvent |
16 | 16 | { |
17 | | - /** |
18 | | - * Name of the button used to submit the form. |
19 | | - */ |
20 | | - private ?string $clickedButton; |
21 | | - |
22 | | - /** |
23 | | - * Hash of options. |
24 | | - * |
25 | | - * @var array<string, mixed> |
26 | | - */ |
27 | | - private array $options; |
28 | | - |
29 | 17 | /** |
30 | 18 | * Response to return after form post-processing. Typically, a RedirectResponse. |
31 | 19 | */ |
32 | | - private ?Response $response; |
33 | | - |
34 | | - /** |
35 | | - * Additional payload populated for event listeners next in priority. |
36 | | - * |
37 | | - * @var array<mixed> |
38 | | - */ |
39 | | - private array $payloads; |
| 20 | + private ?Response $response = null; |
40 | 21 |
|
41 | 22 | /** |
| 23 | + * @param \Symfony\Component\Form\FormInterface<mixed> $form |
42 | 24 | * @param array<string, mixed> $options |
43 | | - * @param array<mixed> $payloads |
| 25 | + * @param array<mixed> $payloads additional payloads populated for event listeners next in priority |
44 | 26 | */ |
45 | 27 | public function __construct( |
46 | 28 | FormInterface $form, |
47 | 29 | mixed $data, |
48 | | - ?string $clickedButton, |
49 | | - array $options = [], |
50 | | - array $payloads = [] |
| 30 | + private readonly ?string $clickedButton, |
| 31 | + private readonly array $options = [], |
| 32 | + private array $payloads = [] |
51 | 33 | ) { |
52 | 34 | parent::__construct($form, $data); |
53 | | - $this->clickedButton = $clickedButton; |
54 | | - $this->options = $options; |
55 | | - $this->payloads = $payloads; |
56 | 35 | } |
57 | 36 |
|
58 | 37 | public function getClickedButton(): ?string |
|
0 commit comments