1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace LoLApi\Api; |
4
|
|
|
|
5
|
|
|
use LoLApi\Result\ApiResult; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* Class MatchApi |
9
|
|
|
* |
10
|
|
|
* @package LoLApi\Api |
11
|
|
|
* @see https://developer.riotgames.com/api-methods/ |
12
|
|
|
*/ |
13
|
|
|
class MatchApi extends BaseApi |
14
|
|
|
{ |
15
|
|
|
const API_URL_MATCH_BY_ID = '/lol/match/v3/matches/{matchId}'; |
16
|
|
|
const API_URL_MATCH_LIST_BY_ACCOUNT = '/lol/match/v3/matchlists/by-account/{accountId}'; |
17
|
|
|
const API_URL_RECENT_MATCH_LIST_BY_ACCOUNT = '/lol/match/v3/matchlists/by-account/{accountId}/recent'; |
18
|
|
|
const API_URL_TIMELINES_BY_MATCH_ID = '/lol/match/v3/timelines/by-match/{matchId}'; |
19
|
|
|
const API_URL_MATCH_ID_BY_TOURNAMENT_CODE = '/lol/match/v3/matches/by-tournament-code/{tournamentCode}/ids'; |
20
|
|
|
const API_URL_MATCH_BY_MATCH_ID_AND_TOURNAMENT_CODE = '/lol/match/v3/matches/{matchId}/by-tournament-code/{tournamentCode}'; |
21
|
|
|
|
22
|
|
|
/** |
23
|
1 |
|
* @param int $matchId |
24
|
|
|
* |
25
|
1 |
|
* @return ApiResult |
26
|
1 |
|
*/ |
27
|
|
|
public function getMatchByMatchId($matchId) |
28
|
1 |
|
{ |
29
|
|
|
$url = str_replace('{matchId}', $matchId, self::API_URL_MATCH_BY_ID); |
30
|
1 |
|
|
31
|
|
|
return $this->callApiUrl($url, [], true); |
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* Get matchlist for ranked games played on given account ID |
36
|
|
|
* and platform ID and filtered using given filter parameters, if any. |
37
|
|
|
* |
38
|
|
|
* @throws \Exception |
39
|
|
|
*/ |
40
|
|
|
public function getMatchlistByAccountId() |
41
|
|
|
{ |
42
|
|
|
throw new \Exception("Method not implemented yet"); |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* Get matchlist for last 20 matches played on given account ID and platform ID. |
47
|
|
|
* |
48
|
|
|
* @throws \Exception |
49
|
|
|
*/ |
50
|
|
|
public function getLastMatchlistByAccountId() |
51
|
|
|
{ |
52
|
|
|
throw new \Exception("Method not implemented yet"); |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* Get match timeline by match ID. |
57
|
|
|
* |
58
|
|
|
* @throws \Exception |
59
|
|
|
*/ |
60
|
|
|
public function getTimelineByMatchId() |
61
|
|
|
{ |
62
|
|
|
throw new \Exception("Method not implemented yet"); |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* Get match IDs by tournament code. |
67
|
|
|
* |
68
|
|
|
* @param string $tournamentCode |
69
|
|
|
* |
70
|
|
|
* @throws \Exception |
71
|
|
|
*/ |
72
|
|
|
public function getMatchIdByTournamentCode($tournamentCode) |
|
|
|
|
73
|
|
|
{ |
74
|
|
|
throw new \Exception("Method not implemented yet"); |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* Get match by match ID and tournament code. |
79
|
|
|
* |
80
|
|
|
* @param int $matchId |
81
|
|
|
* @param string $tournamentCode |
82
|
|
|
* |
83
|
|
|
* @throws \Exception |
84
|
|
|
*/ |
85
|
|
|
public function getMatchByMatchIdAndTournamentCode($matchId, $tournamentCode) |
|
|
|
|
86
|
|
|
{ |
87
|
|
|
throw new \Exception("Method not implemented yet"); |
88
|
|
|
} |
89
|
|
|
} |
90
|
|
|
|
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.