summaryrefslogtreecommitdiff
path: root/tests/temporal/Workflow/WithChildStubWorkflow.php
blob: cdebe3d8b449db57e5985dc60740a53c2f28e83a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php

declare(strict_types=1);

namespace Temporal\Tests\Workflow;

use Temporal\Workflow;
use Temporal\Workflow\WorkflowMethod;

#[Workflow\WorkflowInterface]
class WithChildStubWorkflow
{
    #[WorkflowMethod(name: 'WithChildStubWorkflow')]
    public function handler(string $input): iterable
    {
        $child = Workflow::newChildWorkflowStub(SimpleWorkflow::class);

        return 'Child: ' . (yield $child->handler('child ' . $input));
    }
}