Skip to content

Commit

Permalink
[Form] use never return type in form events
Browse files Browse the repository at this point in the history
  • Loading branch information
HeahDude committed Aug 20, 2023
1 parent 26cedbb commit f389e4a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Event/PostSetDataEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
final class PostSetDataEvent extends FormEvent
{
public function setData(mixed $data): void
public function setData(mixed $data): never
{
throw new BadMethodCallException('Form data cannot be changed during "form.post_set_data", you should use "form.pre_set_data" instead.');
}
Expand Down
2 changes: 1 addition & 1 deletion Event/PostSubmitEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
final class PostSubmitEvent extends FormEvent
{
public function setData(mixed $data): void
public function setData(mixed $data): never
{
throw new BadMethodCallException('Form data cannot be changed during "form.post_submit", you should use "form.pre_submit" or "form.submit" instead.');
}
Expand Down

0 comments on commit f389e4a

Please sign in to comment.