public function scheduleRunContext(): ScheduleRunContext
33
{
34
2
return $this->scheduleRunContext;
35
}
36
37
44
public function task(): Task
38
{
39
44
return $this->task;
40
}
41
42
29
public function result(): Result
43
{
44
29
$this->ensureHasRun();
45
46
28
return $this->result;
47
}
48
49
29
public function setResult(Result $result): void
50
{
51
29
$resultTask = $result->getTask();
52
53
29
if ($resultTask->getId() !== $this->task()->getId()) {
54
1
throw new \LogicException(\sprintf("The result's task (%s: %s) does not match the context's task (%s: %s).", $resultTask->getType(), $resultTask, $this->task()->getType(), $this->task()));