Skip to content

Commit

Permalink
remove shouldCancel
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinGab committed Sep 22, 2024
1 parent a078d36 commit 3aa2dc9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
10 changes: 2 additions & 8 deletions src/Models/Workflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ public function markStepAsCanceled(string $name): static

public function run(): void
{
$this->definition->beforeRun($this);

if (
$this->isFinished() ||
$this->isFailed() ||
Expand All @@ -253,18 +255,10 @@ public function run(): void
return;
}

if ($this->definition->shouldCancel($this)) {
$this->markAsCanceled();

return;
}

if (! $this->definition->shouldRun($this)) {
return;
}

$this->definition->beforeRun($this);

$this->definition->run($this);

$this->definition->afterRun($this);
Expand Down
5 changes: 0 additions & 5 deletions src/WorkflowDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ public function start(): Workflow
return $workflow;
}

public function shouldCancel(Workflow $workflow): bool
{
return false;
}

public function shouldRun(Workflow $workflow): bool
{
return true;
Expand Down

0 comments on commit 3aa2dc9

Please sign in to comment.