Skip to content

Commit

Permalink
Merge pull request #379: Prepare to release 2.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
roxblnfk authored Dec 23, 2023
2 parents 4538cdb + 88b3b96 commit 403baf4
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 9 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "2.7.x-dev"
"dev-master": "2.8.x-dev"
}
},
"config": {
Expand Down
14 changes: 7 additions & 7 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.17.0@c620f6e80d0abfca532b00bda366062aaedf6e5d">
<files psalm-version="5.18.0@b113f3ed0259fd6e212d87c3df80eec95a6abf19">
<file src="src/Activity.php">
<ImplicitToStringCast>
<code>$type</code>
Expand Down Expand Up @@ -928,12 +928,12 @@
</MissingTemplateParam>
</file>
<file src="src/Internal/Repository/ArrayRepository.php">
<InvalidArgument>
<code>$filter</code>
</InvalidArgument>
<InvalidReturnStatement>
<code><![CDATA[$this->entries[$id] ?? null]]></code>
</InvalidReturnStatement>
<InvalidDocblock>
<code>private array $entries = [];</code>
</InvalidDocblock>
<PossiblyInvalidArgument>
<code><![CDATA[\array_filter($this->entries, $filter)]]></code>
</PossiblyInvalidArgument>
<UnsafeInstantiation>
<code><![CDATA[new static(\array_filter($this->entries, $filter))]]></code>
</UnsafeInstantiation>
Expand Down
5 changes: 4 additions & 1 deletion src/Workflow/WorkflowExecution.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
use Temporal\Common\Uuid;
use Temporal\Internal\Marshaller\Meta\Marshal;

/**
* @see \Temporal\Api\Common\V1\WorkflowExecution
*/
class WorkflowExecution
{
/**
Expand All @@ -22,7 +25,7 @@ class WorkflowExecution
* @var string
*/
#[Marshal(name: 'ID')]
#[Marshal(name: 'id')]
#[Marshal(name: 'workflow_id')]
private string $id;

/**
Expand Down
18 changes: 18 additions & 0 deletions tests/Unit/DTO/WorkflowExecutionTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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());
}
}

0 comments on commit 403baf4

Please sign in to comment.