From ada8a13ce8a3410f4260601d213404bff5fa1cc7 Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Fri, 26 Feb 2021 03:40:02 +0300 Subject: initial --- src/Message.php | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/Message.php (limited to 'src/Message.php') diff --git a/src/Message.php b/src/Message.php new file mode 100644 index 0000000..647afad --- /dev/null +++ b/src/Message.php @@ -0,0 +1,36 @@ +type = $type; + } + + /** + * @return array + */ + abstract protected function getContent(): array; + + /** + * @return string + */ + public function serialize(): string { + return json_encode([ + $this->type, + $this->getContent() + ]); + } + +} \ No newline at end of file -- cgit v1.2.3