1 | <?php |
||
16 | class Client |
||
17 | { |
||
18 | /** |
||
19 | * @var ApiClient |
||
20 | */ |
||
21 | private $apiClient; |
||
22 | |||
23 | 30 | public function __construct(ApiClient $apiClient) |
|
27 | |||
28 | /** |
||
29 | * Create default API client setup |
||
30 | */ |
||
31 | 1 | public static function create(string $apiKey): self |
|
40 | |||
41 | 1 | public function getStatus(): Status |
|
48 | |||
49 | 8 | public function getMatches(MatchesQuery $query = null): Matches |
|
57 | |||
58 | 7 | public function getMatch(string $matchId): DetailedMatch |
|
65 | |||
66 | 5 | public function getPlayers(PlayersQuery $query = null): Players |
|
74 | |||
75 | public function getPlayer(string $playerId): DetailedPlayer |
||
76 | { |
||
77 | $responseData = $this->apiClient->sendRequestToEndPoint( |
||
78 | '/shards/global/players/' . $playerId |
||
79 | ); |
||
80 | return DetailedPlayer::createFromArray($responseData['data']); |
||
81 | } |
||
82 | |||
83 | 6 | public function getTeams(TeamsQuery $query = null): Teams |
|
91 | } |
||
92 |