From 3654005a74aa582f0aa6c2f047feed7b4af1f372 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 25 Aug 2025 19:45:55 +0200 Subject: [PATCH] Add missing parameter in creation of new AssignTaskEvent --- .../ChillTaskBundle/Controller/SingleTaskController.php | 2 +- src/Bundle/ChillTaskBundle/Event/AssignTaskEvent.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php index 493681d5c..ac59de62e 100644 --- a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php +++ b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php @@ -536,7 +536,7 @@ final class SingleTaskController extends AbstractController if (null !== $task->getAssignee()) { $this->eventDispatcher->dispatch( - new AssignTaskEvent($task), + new AssignTaskEvent($task, null), AssignTaskEvent::PERSIST ); } diff --git a/src/Bundle/ChillTaskBundle/Event/AssignTaskEvent.php b/src/Bundle/ChillTaskBundle/Event/AssignTaskEvent.php index 0a98d1edf..a7eca02f4 100644 --- a/src/Bundle/ChillTaskBundle/Event/AssignTaskEvent.php +++ b/src/Bundle/ChillTaskBundle/Event/AssignTaskEvent.php @@ -20,7 +20,7 @@ class AssignTaskEvent extends Event final public const PERSIST = 'chill_task.assign_task'; public function __construct( private readonly SingleTask $task, - private readonly User $initialAssignee, + private readonly ?User $initialAssignee, ) {} public function getTask(): SingleTask @@ -28,7 +28,7 @@ class AssignTaskEvent extends Event return $this->task; } - public function getInitialAssignee(): User + public function getInitialAssignee(): ?User { return $this->initialAssignee; }