Skip to content

Commit 216f325

Browse files
committed
Update readme
1 parent d4ca396 commit 216f325

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ class RegisterWorkflow {
8484
#[\Temporal\Workflow\WorkflowMethod]
8585
public function run(string $user) {
8686
yield \Temporal\Promise::all([
87-
WorkflowStub::childWorkflow(GreetingWorkflow::class, executionTimeout: '1 hour'),
88-
WorkflowStub::childWorkflow(SubscribeNewsWorkflow::class, executionTimeout: '10 minutes'),
89-
WorkflowStub::childWorkflow(PrepareUserEnvironmentWorkflow::class, executionTimeout: '1 hour'),
87+
WorkflowStub::childWorkflow(GreetingWorkflow::class, executionTimeout: '1 hour')->greet($user),
88+
WorkflowStub::childWorkflow(SubscribeNewsWorkflow::class, executionTimeout: '10 minutes')->subscribe($user),
89+
WorkflowStub::childWorkflow(PrepareUserSpaceWorkflow::class, executionTimeout: '1 hour')->handle($user),
9090
])->then(
9191
// Suppress failures
9292
onRejected: static fn () => null,

src/Factory/ActivityStub.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ final class ActivityStub
2323
*
2424
* @template T of object
2525
*
26-
* @param class-string<T> $activity
26+
* @param class-string<T> $class
2727
* @param non-empty-string|null $taskQueue
2828
* @param int<0, max>|null $retryAttempts Maximum number of attempts. When exceeded the retries stop even
2929
* if not expired yet. If not set or set to 0, it means unlimited, and rely on activity
@@ -60,7 +60,7 @@ final class ActivityStub
6060
* @return T|ActivityProxy
6161
*/
6262
public static function activity(
63-
string $activity,
63+
string $class,
6464
?string $taskQueue = null,
6565
?int $retryAttempts = null,
6666
\DateInterval|string|int|null $retryInitInterval = null,
@@ -74,7 +74,7 @@ public static function activity(
7474
\Stringable|string|null $activityId = null,
7575
int $cancellationType = 0,
7676
): object {
77-
$attributes = self::readAttributes($activity);
77+
$attributes = self::readAttributes($class);
7878

7979
// Retry options
8080
$retryOptions = RetryOptions::create(
@@ -99,7 +99,7 @@ public static function activity(
9999
$activityId === null or $options = $options->withActivityId((string)$activityId);
100100
$cancellationType === null or $options = $options->withCancellationType($cancellationType);
101101

102-
return Workflow::newActivityStub($activity, $options);
102+
return Workflow::newActivityStub($class, $options);
103103
}
104104

105105
/**

tests/Unit/Factory/ActivityStubTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function testDefaultsFromAttributes()
3131
{
3232
/** @var \Temporal\Activity\ActivityOptions $options */
3333
$options = ActivityStub::activity(
34-
activity: AttributedWithoutInterface::class,
34+
class: AttributedWithoutInterface::class,
3535
)->options;
3636

3737
$this->assertSame('test-queue', $options->taskQueue);
@@ -46,7 +46,7 @@ public function testAttributeOverrides()
4646
{
4747
/** @var \Temporal\Activity\ActivityOptions $options */
4848
$options = ActivityStub::activity(
49-
activity: AttributedWithoutInterface::class,
49+
class: AttributedWithoutInterface::class,
5050
taskQueue: 'test-queue-override',
5151
retryAttempts: 0,
5252
retryInitInterval: 10,

0 commit comments

Comments
 (0)