| 1 | <?php |
||
| 14 | class Client |
||
| 15 | { |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var ApiClient |
||
| 19 | */ |
||
| 20 | private $apiClient; |
||
| 21 | |||
| 22 | 13 | public function __construct(ApiClient $apiClient) |
|
| 26 | |||
| 27 | public static function create(string $apiKey): Client |
||
| 28 | { |
||
| 29 | return new Client( |
||
| 30 | new ApiClient( |
||
| 31 | $apiKey, |
||
| 32 | new GuzzleClient() |
||
| 33 | ) |
||
| 34 | ); |
||
| 35 | } |
||
| 36 | |||
| 37 | 8 | public function getMatches(MatchesQuery $query = null): Matches |
|
| 45 | |||
| 46 | 2 | public function getMatch(string $matchId): Match |
|
| 53 | |||
| 54 | 2 | public function getPlayers(PlayersQuery $query = null): Players |
|
| 62 | |||
| 63 | 1 | public function getPlayer(string $playerId): Player |
|
| 70 | } |
||
| 71 |