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; }