1
0
Fork 0
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:
Robin Appelman 2022-01-23 16:04:09 +01:00
commit 4f617d12d4
11 changed files with 700 additions and 546 deletions

View file

@ -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,