Skip to content

Commit 4e58735

Browse files
committed
Transfer payloads as strings
1 parent f316846 commit 4e58735

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/Message/Error.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
final class Error implements NegativeOutcome
1010
{
1111
private string $id;
12-
private UnitOfError $error;
12+
private string $error;
1313

1414
public function __construct(string $id, UnitOfError $error)
1515
{
1616
$this->id = $id;
17-
$this->error = $error;
17+
$this->error = serialize($error);
1818
}
1919

2020
public function id(): string
@@ -24,6 +24,6 @@ public function id(): string
2424

2525
public function error(): UnitOfError
2626
{
27-
return $this->error;
27+
return unserialize($this->error);
2828
}
2929
}

src/Message/Result.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
final class Result implements PositiveOutcome
1010
{
1111
private string $id;
12-
private UnitOfResult $result;
12+
private string $result;
1313

1414
public function __construct(string $id, UnitOfResult $result)
1515
{
1616
$this->id = $id;
17-
$this->result = $result;
17+
$this->result = serialize($result);
1818
}
1919

2020
public function id(): string
@@ -24,6 +24,6 @@ public function id(): string
2424

2525
public function result(): UnitOfResult
2626
{
27-
return $this->result;
27+
return unserialize($this->result);
2828
}
2929
}

src/Message/Work.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
final class Work implements Message
1111
{
1212
private string $id;
13-
private UnitOfWork $work;
13+
private string $work;
1414

1515
public function __construct(string $id, UnitOfWork $work)
1616
{
1717
$this->id = $id;
18-
$this->work = $work;
18+
$this->work = serialize($work);
1919
}
2020

2121
public function id(): string
@@ -25,6 +25,6 @@ public function id(): string
2525

2626
public function work(): UnitOfWork
2727
{
28-
return $this->work;
28+
return unserialize($this->work);
2929
}
3030
}

0 commit comments

Comments
 (0)