Skip to content

Commit d3a854b

Browse files
committed
return this from set default init task
1 parent 2875a4f commit d3a854b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Taskmaster.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,15 +592,17 @@ public function setDefaultInitTaskFactory(?TaskFactoryInterface $initTaskFactory
592592
* a class name, a new instance of the class will be created for each worker instance.
593593
*
594594
* @param TaskInterface|class-string<TaskInterface> $task
595-
* @return void
595+
* @return $this
596596
*/
597-
public function setDefaultInitTask(TaskInterface|string $task): void
597+
public function setDefaultInitTask(TaskInterface|string $task): static
598598
{
599599
if (is_string($task)) {
600600
$this->initTaskFactory = new InstanceTaskFactory($task);
601601
} else {
602602
$this->initTaskFactory = new CloneTaskFactory($task);
603603
}
604+
605+
return $this;
604606
}
605607

606608
/**

0 commit comments

Comments
 (0)