First unit tests, misc fixes

This commit is contained in:
2024-03-12 01:45:21 +01:00
parent b3476881e1
commit 8be2e81054
8 changed files with 173 additions and 22 deletions

View File

@ -23,11 +23,11 @@ class Message
public function __construct(
array $topic,
?string $type,
?string $data,
?bool $private,
?string $id,
?int $retry
?string $data=null,
?string $type=null,
?bool $private=null,
?string $id=null,
?int $retry=null
)
{
$this->topic = $topic;
@ -60,7 +60,7 @@ class Message
topic: (array)$data['topic'],
type: $data['type']??null,
data: $data['data']??null,
private: match ($data['private']??null) { "on" => true, null => null, default => false },
private: match ($data['private']??null) { "on" => true, true => true, null => null, default => false },
id: $data['id']??null,
retry: $data['retry']??null,
);

View File

@ -7,4 +7,6 @@ interface SubscriberInterface
public function deliver(Message $message): void;
public function isAuthorized(): bool;
public function getPayload(): ?array;
}