mirror of
https://codeberg.org/demostf/api.git
synced 2026-06-03 18:04:08 +02:00
fix chat listing
This commit is contained in:
parent
611e7c3415
commit
06379c2363
3 changed files with 40 additions and 4 deletions
|
|
@ -4,7 +4,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Demostf\API\Demo;
|
||||
|
||||
class ChatMessage {
|
||||
class ChatMessage implements \JsonSerializable {
|
||||
/** @var string */
|
||||
private $user;
|
||||
|
||||
|
|
@ -47,4 +47,12 @@ class ChatMessage {
|
|||
public function getMessage(): string {
|
||||
return $this->message;
|
||||
}
|
||||
|
||||
public function jsonSerialize() {
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'time' => $this->time,
|
||||
'message' => $this->message,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue