Skip to content

Commit f389e4a

Browse files
committed
[Form] use never return type in form events
1 parent 26cedbb commit f389e4a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Event/PostSetDataEvent.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323
final class PostSetDataEvent extends FormEvent
2424
{
25-
public function setData(mixed $data): void
25+
public function setData(mixed $data): never
2626
{
2727
throw new BadMethodCallException('Form data cannot be changed during "form.post_set_data", you should use "form.pre_set_data" instead.');
2828
}

Event/PostSubmitEvent.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323
final class PostSubmitEvent extends FormEvent
2424
{
25-
public function setData(mixed $data): void
25+
public function setData(mixed $data): never
2626
{
2727
throw new BadMethodCallException('Form data cannot be changed during "form.post_submit", you should use "form.pre_submit" or "form.submit" instead.');
2828
}

0 commit comments

Comments
 (0)