mirror of
https://codeberg.org/demostf/api.git
synced 2026-06-03 18:04:08 +02:00
extract chat handling
This commit is contained in:
parent
66d177e23a
commit
9c963fd3af
7 changed files with 149 additions and 29 deletions
46
src/Demo/ChatMessage.php
Normal file
46
src/Demo/ChatMessage.php
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?php namespace Demostf\API\Demo;
|
||||
|
||||
class ChatMessage {
|
||||
/** @var string */
|
||||
private $user;
|
||||
|
||||
/** @var integer */
|
||||
private $time;
|
||||
|
||||
/** @var string */
|
||||
private $message;
|
||||
|
||||
/**
|
||||
* ChatMessage constructor.
|
||||
*
|
||||
* @param string $user
|
||||
* @param int $time
|
||||
* @param string $message
|
||||
*/
|
||||
public function __construct(string $user, int $time, string $message) {
|
||||
$this->user = $user;
|
||||
$this->time = $time;
|
||||
$this->message = $message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getUser(): string {
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getTime(): int {
|
||||
return $this->time;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getMessage(): string {
|
||||
return $this->message;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue