mirror of
https://codeberg.org/demostf/api.git
synced 2026-06-04 02:14:06 +02:00
more type hints
This commit is contained in:
parent
376d7e79ca
commit
4f617d12d4
11 changed files with 700 additions and 546 deletions
|
|
@ -7,14 +7,9 @@ namespace Demostf\API\Demo;
|
|||
use JsonSerializable;
|
||||
|
||||
class ChatMessage implements JsonSerializable {
|
||||
/** @var string */
|
||||
private $user;
|
||||
|
||||
/** @var int */
|
||||
private $time;
|
||||
|
||||
/** @var string */
|
||||
private $message;
|
||||
private string $user;
|
||||
private int $time;
|
||||
private string $message;
|
||||
|
||||
/**
|
||||
* ChatMessage constructor.
|
||||
|
|
@ -37,6 +32,10 @@ class ChatMessage implements JsonSerializable {
|
|||
return $this->message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array{'user': string, 'time': int, 'message': string}
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function jsonSerialize() {
|
||||
return [
|
||||
'user' => $this->user,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue