Total Complexity | 3 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | abstract class AbstractSnapshotStore implements SnapshotStore |
||
23 | { |
||
24 | /** |
||
25 | * @var AggregateSerializer |
||
26 | */ |
||
27 | private $serializer; |
||
28 | |||
29 | /** |
||
30 | * AbstractSnapshotStore constructor. |
||
31 | * |
||
32 | * @param AggregateSerializer $serializer |
||
33 | */ |
||
34 | public function __construct(AggregateSerializer $serializer) |
||
35 | { |
||
36 | $this->serializer = $serializer; |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * Serialize aggregate root. |
||
41 | * |
||
42 | * @param AggregateRoot $aggregateRoot |
||
43 | * |
||
44 | * @return string |
||
45 | */ |
||
46 | final protected function serializeAggregateRoot(AggregateRoot $aggregateRoot): string |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * Deserialize aggregate root. |
||
53 | * |
||
54 | * @param string $serialized |
||
55 | * |
||
56 | * @return AggregateRoot |
||
57 | */ |
||
58 | final protected function deserializeAggregateRoot(string $serialized): AggregateRoot |
||
61 | } |
||
62 | } |
||
63 |