Skip to content

Commit 0ff4b67

Browse files
committed
Address dynamic workflow review feedback
1 parent f01d7ec commit 0ff4b67

4 files changed

Lines changed: 8 additions & 20 deletions

File tree

src/Workflow/WorkflowMethod.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,7 @@ final class WorkflowMethod
3838
/**
3939
* Marks this as a dynamic (catch-all) workflow: it is invoked when the
4040
* worker receives a workflow whose type name is not statically registered.
41-
* At most one dynamic workflow may be registered per worker. The handler
42-
* reads the actual type name via {@see \Temporal\Workflow::getInfo()} and
43-
* receives the raw arguments (declare a {@see \Temporal\DataConverter\ValuesInterface}
44-
* parameter to access them).
41+
* At most one dynamic workflow may be registered per worker.
4542
*/
4643
#[Immutable]
4744
public bool $dynamic = false;

tests/Unit/Declaration/Fixture/WorkflowWithAnotherDynamic.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@
1414
use Temporal\Workflow\WorkflowInterface;
1515
use Temporal\Workflow\WorkflowMethod;
1616

17-
/** @WorkflowInterface */
1817
#[WorkflowInterface]
1918
class WorkflowWithAnotherDynamic
2019
{
21-
/** @WorkflowMethod(dynamic=true) */
2220
#[WorkflowMethod(dynamic: true)]
2321
public function handler(): void
2422
{

tests/Unit/Declaration/Fixture/WorkflowWithDynamic.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@
1414
use Temporal\Workflow\WorkflowInterface;
1515
use Temporal\Workflow\WorkflowMethod;
1616

17-
/** @WorkflowInterface */
1817
#[WorkflowInterface]
1918
class WorkflowWithDynamic
2019
{
21-
/** @WorkflowMethod(dynamic=true) */
2220
#[WorkflowMethod(dynamic: true)]
2321
public function handler(): void
2422
{

tests/Unit/Declaration/WorkflowDeclarationTestCase.php

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,26 +54,21 @@ public function testWorkflowWithoutHandler(WorkflowReader $reader): void
5454
$this->assertNull($prototype->getHandler());
5555
}
5656

57-
/**
58-
* @param WorkflowReader $reader
59-
* @throws \ReflectionException
60-
*/
57+
/** @throws \ReflectionException */
6158
#[TestDox("Reading a dynamic (catch-all) workflow sets the dynamic flag")]
62-
#[DataProvider('workflowReaderDataProvider')]
63-
public function testDynamicWorkflow(WorkflowReader $reader): void
59+
public function testDynamicWorkflow(): void
6460
{
61+
$reader = new WorkflowReader(new AttributeReader());
62+
6563
$this->assertTrue($reader->fromClass(WorkflowWithDynamic::class)->isDynamic());
6664
$this->assertFalse($reader->fromClass(SimpleWorkflow::class)->isDynamic());
6765
}
6866

69-
/**
70-
* @param WorkflowReader $reader
71-
* @throws \ReflectionException
72-
*/
67+
/** @throws \ReflectionException */
7368
#[TestDox("At most one dynamic workflow may be registered per worker")]
74-
#[DataProvider('workflowReaderDataProvider')]
75-
public function testMultipleDynamicWorkflowsAreRejected(WorkflowReader $reader): void
69+
public function testMultipleDynamicWorkflowsAreRejected(): void
7670
{
71+
$reader = new WorkflowReader(new AttributeReader());
7772
$collection = new WorkflowCollection();
7873
$collection->add($reader->fromClass(WorkflowWithDynamic::class));
7974

0 commit comments

Comments
 (0)