Skip to content

Commit

Permalink
Make workflowName optional
Browse files Browse the repository at this point in the history
  • Loading branch information
stevebauman committed Feb 28, 2024
1 parent 73cdd0f commit df05556
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/AbstractWorkflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

use Closure;
use Illuminate\Container\Container;
use Illuminate\Support\Str;
use Sassnowski\Venture\Manager\WorkflowManagerInterface;
use Sassnowski\Venture\Models\Workflow;
use Sassnowski\Venture\Testing\WorkflowTester;
Expand Down Expand Up @@ -87,8 +88,8 @@ public function run(?string $connection = null): Workflow
return $manager->startWorkflow($this, $connection);
}

protected function define(string $workflowName = ''): WorkflowDefinition
protected function define(?string $workflowName = null): WorkflowDefinition
{
return new WorkflowDefinition($this, $workflowName);
return new WorkflowDefinition($this, $workflowName ?? Str::headline(class_basename(static::class)));
}
}

0 comments on commit df05556

Please sign in to comment.