diff --git a/composer.json b/composer.json index e8f725e1..0b465a69 100644 --- a/composer.json +++ b/composer.json @@ -91,7 +91,7 @@ }, "extra": { "branch-alias": { - "dev-master": "2.7.x-dev" + "dev-master": "2.8.x-dev" } }, "config": { diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 3d88b113..77291bae 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,5 +1,5 @@ - + $type @@ -928,12 +928,12 @@ - - $filter - - - entries[$id] ?? null]]> - + + private array $entries = []; + + + entries, $filter)]]> + entries, $filter))]]> diff --git a/src/Workflow/WorkflowExecution.php b/src/Workflow/WorkflowExecution.php index 7dad06b8..16fee491 100644 --- a/src/Workflow/WorkflowExecution.php +++ b/src/Workflow/WorkflowExecution.php @@ -14,6 +14,9 @@ use Temporal\Common\Uuid; use Temporal\Internal\Marshaller\Meta\Marshal; +/** + * @see \Temporal\Api\Common\V1\WorkflowExecution + */ class WorkflowExecution { /** @@ -22,7 +25,7 @@ class WorkflowExecution * @var string */ #[Marshal(name: 'ID')] - #[Marshal(name: 'id')] + #[Marshal(name: 'workflow_id')] private string $id; /** diff --git a/tests/Unit/DTO/WorkflowExecutionTestCase.php b/tests/Unit/DTO/WorkflowExecutionTestCase.php index ae447a9b..6e976561 100644 --- a/tests/Unit/DTO/WorkflowExecutionTestCase.php +++ b/tests/Unit/DTO/WorkflowExecutionTestCase.php @@ -11,6 +11,8 @@ namespace Temporal\Tests\Unit\DTO; +use Temporal\DataConverter\DataConverter; +use Temporal\Internal\Marshaller\ProtoToArrayConverter; use Temporal\Workflow\WorkflowExecution; class WorkflowExecutionTestCase extends DTOMarshallingTestCase @@ -29,4 +31,20 @@ public function testMarshalling(): void $this->assertSame($expected, $this->marshal($dto)); } + + public function testUnmarshalFromProto(): void + { + $converter = DataConverter::createDefault(); + $protoConverter = new ProtoToArrayConverter($converter); + $message = (new \Temporal\Api\Common\V1\WorkflowExecution()) + ->setWorkflowId('489-wf-id-test') + ->setRunId('wf-run-id-test'); + $values = $protoConverter->convert($message); + $dto = new WorkflowExecution(); + + $result = $this->marshaller->unmarshal($values, $dto); + + $this->assertSame('489-wf-id-test', $result->getID()); + $this->assertSame('wf-run-id-test', $result->getRunID()); + } }