Skip to content

Commit 3aa2dc9

Browse files
committed
remove shouldCancel
1 parent a078d36 commit 3aa2dc9

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

src/Models/Workflow.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,8 @@ public function markStepAsCanceled(string $name): static
245245

246246
public function run(): void
247247
{
248+
$this->definition->beforeRun($this);
249+
248250
if (
249251
$this->isFinished() ||
250252
$this->isFailed() ||
@@ -253,18 +255,10 @@ public function run(): void
253255
return;
254256
}
255257

256-
if ($this->definition->shouldCancel($this)) {
257-
$this->markAsCanceled();
258-
259-
return;
260-
}
261-
262258
if (! $this->definition->shouldRun($this)) {
263259
return;
264260
}
265261

266-
$this->definition->beforeRun($this);
267-
268262
$this->definition->run($this);
269263

270264
$this->definition->afterRun($this);

src/WorkflowDefinition.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ public function start(): Workflow
3030
return $workflow;
3131
}
3232

33-
public function shouldCancel(Workflow $workflow): bool
34-
{
35-
return false;
36-
}
37-
3833
public function shouldRun(Workflow $workflow): bool
3934
{
4035
return true;

0 commit comments

Comments
 (0)