diff --git a/src/Taskmaster.php b/src/Taskmaster.php index 4b84da2..8231ee4 100644 --- a/src/Taskmaster.php +++ b/src/Taskmaster.php @@ -592,15 +592,17 @@ public function setDefaultInitTaskFactory(?TaskFactoryInterface $initTaskFactory * a class name, a new instance of the class will be created for each worker instance. * * @param TaskInterface|class-string $task - * @return void + * @return $this */ - public function setDefaultInitTask(TaskInterface|string $task): void + public function setDefaultInitTask(TaskInterface|string $task): static { if (is_string($task)) { $this->initTaskFactory = new InstanceTaskFactory($task); } else { $this->initTaskFactory = new CloneTaskFactory($task); } + + return $this; } /**