Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare to release 2.7.0 #379

Merged
merged 2 commits into from
Dec 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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());
}
}
Loading