Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
roxblnfk committed Apr 4, 2024
1 parent d4ca396 commit 216f325
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ class RegisterWorkflow {
#[\Temporal\Workflow\WorkflowMethod]
public function run(string $user) {
yield \Temporal\Promise::all([
WorkflowStub::childWorkflow(GreetingWorkflow::class, executionTimeout: '1 hour'),
WorkflowStub::childWorkflow(SubscribeNewsWorkflow::class, executionTimeout: '10 minutes'),
WorkflowStub::childWorkflow(PrepareUserEnvironmentWorkflow::class, executionTimeout: '1 hour'),
WorkflowStub::childWorkflow(GreetingWorkflow::class, executionTimeout: '1 hour')->greet($user),
WorkflowStub::childWorkflow(SubscribeNewsWorkflow::class, executionTimeout: '10 minutes')->subscribe($user),
WorkflowStub::childWorkflow(PrepareUserSpaceWorkflow::class, executionTimeout: '1 hour')->handle($user),
])->then(
// Suppress failures
onRejected: static fn () => null,
Expand Down
8 changes: 4 additions & 4 deletions src/Factory/ActivityStub.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ final class ActivityStub
*
* @template T of object
*
* @param class-string<T> $activity
* @param class-string<T> $class
* @param non-empty-string|null $taskQueue
* @param int<0, max>|null $retryAttempts Maximum number of attempts. When exceeded the retries stop even
* if not expired yet. If not set or set to 0, it means unlimited, and rely on activity
Expand Down Expand Up @@ -60,7 +60,7 @@ final class ActivityStub
* @return T|ActivityProxy
*/
public static function activity(
string $activity,
string $class,
?string $taskQueue = null,
?int $retryAttempts = null,
\DateInterval|string|int|null $retryInitInterval = null,
Expand All @@ -74,7 +74,7 @@ public static function activity(
\Stringable|string|null $activityId = null,
int $cancellationType = 0,
): object {
$attributes = self::readAttributes($activity);
$attributes = self::readAttributes($class);

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

Check failure on line 100 in src/Factory/ActivityStub.php

View workflow job for this annotation

GitHub Actions / Psalm Validation (PHP 8.2, OS ubuntu-latest)

DocblockTypeContradiction

src/Factory/ActivityStub.php:100:9: DocblockTypeContradiction: int does not contain null (see https://psalm.dev/155)

return Workflow::newActivityStub($activity, $options);
return Workflow::newActivityStub($class, $options);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Factory/ActivityStubTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testDefaultsFromAttributes()
{
/** @var \Temporal\Activity\ActivityOptions $options */
$options = ActivityStub::activity(
activity: AttributedWithoutInterface::class,
class: AttributedWithoutInterface::class,
)->options;

$this->assertSame('test-queue', $options->taskQueue);
Expand All @@ -46,7 +46,7 @@ public function testAttributeOverrides()
{
/** @var \Temporal\Activity\ActivityOptions $options */
$options = ActivityStub::activity(
activity: AttributedWithoutInterface::class,
class: AttributedWithoutInterface::class,
taskQueue: 'test-queue-override',
retryAttempts: 0,
retryInitInterval: 10,
Expand Down

0 comments on commit 216f325

Please sign in to comment.