1
0
Fork 0
mirror of https://codeberg.org/demostf/api.git synced 2026-06-04 02:14:06 +02:00

stricter cs

This commit is contained in:
Robin Appelman 2017-07-30 15:03:52 +02:00
commit d9a843ecd6
54 changed files with 346 additions and 168 deletions

View file

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace Demostf\API\Data;
@ -78,7 +80,7 @@ class DemoPlayer implements \JsonSerializable {
}
public static function fromRow($row): DemoPlayer {
return new DemoPlayer(
return new self(
$row['id'],
$row['user_id'],
$row['name'],
@ -103,7 +105,7 @@ class DemoPlayer implements \JsonSerializable {
'avatar' => $this->getAvatar(),
'kills' => $this->getKills(),
'assists' => $this->getAssists(),
'deaths' => $this->getDeaths()
'deaths' => $this->getDeaths(),
];
}
}

View file

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace Demostf\API\Data;

View file

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace Demostf\API\Data;
@ -19,11 +21,11 @@ class ParsedDemo {
/**
* ParsedDemo constructor.
*
* @param int $redScore
* @param int $blueScore
* @param ChatMessage[] $chat
* @param int $redScore
* @param int $blueScore
* @param ChatMessage[] $chat
* @param ParsedPlayer[] $players
* @param ParsedKill[] $kills
* @param ParsedKill[] $kills
*/
public function __construct(int $redScore, int $blueScore, array $chat, array $players, array $kills) {
$this->redScore = $redScore;

View file

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace Demostf\API\Data;

View file

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace Demostf\API\Data;

View file

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace Demostf\API\Data;

View file

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace Demostf\API\Data;

View file

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace Demostf\API\Data;

View file

@ -1,4 +1,6 @@
<?php declare(strict_types = 1);
<?php
declare(strict_types=1);
namespace Demostf\API\Data;
@ -47,13 +49,13 @@ class User implements \JsonSerializable {
'id' => $this->getId(),
'steamid' => $this->getSteamId(),
'name' => $this->getName(),
'avatar' => $this->getAvatar()
'avatar' => $this->getAvatar(),
];
}
public static function fromRow(array $row): User {
return new User(
(int)$row['id'],
return new self(
(int) $row['id'],
$row['steamid'],
$row['name'],
$row['avatar'],