diff --git a/src/Runner.php b/src/Runner.php index 0346b44..1071adc 100644 --- a/src/Runner.php +++ b/src/Runner.php @@ -53,7 +53,7 @@ public function withRun(): RunnerInterface foreach ($jobs->getGraph() as $jobs) { foreach ($jobs as $job) { $promises[] = enqueueCallable( - 'Chevere\\Workflow\\workflowRunnerForJob', + 'Chevere\\Workflow\\runnerForJob', $new, $job, ); diff --git a/src/functions.php b/src/functions.php index b0b913e..740e1bb 100644 --- a/src/functions.php +++ b/src/functions.php @@ -34,7 +34,7 @@ function job( return new Job($action, ...$namedArguments); } -function workflowRunnerForJob( +function runnerForJob( RunnerInterface $workflowRunner, string $job, ): RunnerInterface { @@ -49,7 +49,7 @@ function workflowRunnerForJob( /** * @param Array $vars */ -function workflowRun( +function run( WorkflowInterface $workflow, array $vars = [], ?ContainerInterface $container = null diff --git a/tests/RunnerParallelTest.php b/tests/RunnerParallelTest.php index 4ee28cd..073e20b 100644 --- a/tests/RunnerParallelTest.php +++ b/tests/RunnerParallelTest.php @@ -16,8 +16,8 @@ use function Chevere\Filesystem\fileForPath; use Chevere\Tests\_resources\src\TestActionFileWrite; use function Chevere\Workflow\job; +use function Chevere\Workflow\run; use function Chevere\Workflow\workflow; -use function Chevere\Workflow\workflowRun; use PHPUnit\Framework\TestCase; final class RunnerParallelTest extends TestCase @@ -39,7 +39,7 @@ public function testParallelRunner(): void ), ); $arguments = []; - workflowRun($workflow, ...$arguments); + run($workflow, ...$arguments); $this->assertStringEqualsFile( $file->path()->__toString(), '^^$$' diff --git a/tests/RunnerSequentialTest.php b/tests/RunnerSequentialTest.php index bc049ab..f38fec7 100644 --- a/tests/RunnerSequentialTest.php +++ b/tests/RunnerSequentialTest.php @@ -16,8 +16,8 @@ use function Chevere\Filesystem\fileForPath; use Chevere\Tests\_resources\src\TestActionFileWrite; use function Chevere\Workflow\job; +use function Chevere\Workflow\run; use function Chevere\Workflow\workflow; -use function Chevere\Workflow\workflowRun; use PHPUnit\Framework\TestCase; final class RunnerSequentialTest extends TestCase @@ -40,7 +40,7 @@ public function testSequentialRunner(): void )->withDepends('j1'), ); $arguments = []; - $run = workflowRun($workflow, ...$arguments); + $run = run($workflow, ...$arguments); $this->assertStringEqualsFile( $file->path()->__toString(), str_repeat('^$', 2) diff --git a/tests/RunnerTest.php b/tests/RunnerTest.php index 9e929e3..601b513 100644 --- a/tests/RunnerTest.php +++ b/tests/RunnerTest.php @@ -18,10 +18,10 @@ use Chevere\Tests\_resources\src\TestActionParamsFooResponse1; use function Chevere\Workflow\job; use Chevere\Workflow\Run; +use function Chevere\Workflow\run; use Chevere\Workflow\Runner; +use function Chevere\Workflow\runnerForJob; use function Chevere\Workflow\workflow; -use function Chevere\Workflow\workflowRun; -use function Chevere\Workflow\workflowRunnerForJob; use PHPUnit\Framework\TestCase; final class RunnerTest extends TestCase @@ -47,14 +47,14 @@ public function testWorkflowRunner(): void ]; $workflowRun = new Run($workflow, ...$arguments); $workflowRunner = new Runner($workflowRun, new Container()); - $workflowRunnerForStep1 = workflowRunnerForJob( + $workflowRunnerForStep1 = runnerForJob( $workflowRunner, 'step1' ); $workflowRunner = (new Runner($workflowRun, new Container())) ->withRun(); - workflowRunnerForJob($workflowRunner, 'step1'); - $workflowRunnerForStep2 = workflowRunnerForJob( + runnerForJob($workflowRunner, 'step1'); + $workflowRunnerForStep2 = runnerForJob( $workflowRunner, 'step2' ); @@ -68,7 +68,7 @@ public function testWorkflowRunner(): void $workflowRun->get('step2')->data() ); $this->assertSame($workflowRun, $workflowRunner->run()); - $workflowRunFunction = workflowRun($workflow, $arguments); + $workflowRunFunction = run($workflow, $arguments); $this->assertEquals( $workflowRunFunction->workflow(), $workflowRunner->run()->workflow()