1
0
Fork 0
mirror of https://codeberg.org/demostf/api.git synced 2026-06-03 09:54:17 +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,12 +7,9 @@ namespace Demostf\API\Data;
use JsonSerializable;
class SteamUser implements JsonSerializable {
/** @var int */
private $id;
/** @var string */
private $steamId;
/** @var string */
private $name;
private int $id;
private string $steamId;
private string $name;
public function __construct(int $id, string $steamId, string $name) {
$this->id = $id;
@ -31,7 +28,10 @@ class SteamUser implements JsonSerializable {
public function getName(): string {
return $this->name;
}
/**
* @return array{'id': int, 'name': string, 'steamid': string}
*/
#[\ReturnTypeWillChange]
public function jsonSerialize() {
return [
'id' => $this->getId(),