Skip to content

Allow for extension of message repositories #12

New issue

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

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

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@

class DoctrineUuidV4MessageRepository implements MessageRepository
{
private TableSchema $tableSchema;
private UuidEncoder $uuidEncoder;
protected TableSchema $tableSchema;
protected UuidEncoder $uuidEncoder;

public function __construct(
private Connection $connection,
private string $tableName,
private MessageSerializer $serializer,
private int $jsonEncodeOptions = 0,
protected Connection $connection,
protected string $tableName,
protected MessageSerializer $serializer,
protected int $jsonEncodeOptions = 0,
?TableSchema $tableSchema = null,
?UuidEncoder $uuidEncoder = null,
) {
Expand Down Expand Up @@ -161,7 +161,7 @@ private function createQueryBuilder(): QueryBuilder
/**
* @psalm-return Generator<Message>
*/
private function yieldMessagesFromPayloads(Traversable $payloads): Generator
protected function yieldMessagesFromPayloads(Traversable $payloads): Generator
{
foreach ($payloads as $payload) {
yield $message = $this->serializer->unserializePayload(json_decode($payload['payload'], true));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@

class IlluminateUuidV4MessageRepository implements MessageRepository
{
private TableSchema $tableSchema;
private UuidEncoder $uuidEncoder;
protected TableSchema $tableSchema;
protected UuidEncoder $uuidEncoder;

public function __construct(
private ConnectionInterface $connection,
private string $tableName,
private MessageSerializer $serializer,
private int $jsonEncodeOptions = 0,
protected ConnectionInterface $connection,
protected string $tableName,
protected MessageSerializer $serializer,
protected int $jsonEncodeOptions = 0,
?TableSchema $tableSchema = null,
?UuidEncoder $uuidEncoder = null,
) {
Expand Down Expand Up @@ -106,7 +106,7 @@ public function retrieveAllAfterVersion(AggregateRootId $id, int $aggregateRootV
/**
* @psalm-return Generator<Message>
*/
private function yieldMessagesForResult(Collection $result): Generator
protected function yieldMessagesForResult(Collection $result): Generator
{
foreach ($result as $row) {
$message = $this->serializer->unserializePayload(json_decode($row->payload, true));
Expand Down