Total Complexity | 6 |
Total Lines | 63 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
9 | class Client implements ClientInterface |
||
10 | { |
||
11 | private const TEAMS = '/v1/competitions/467/teams'; |
||
12 | private const GAMES = '/v1/competitions/467/fixtures'; |
||
13 | |||
14 | /** |
||
15 | * @var GuzzleHttpClient |
||
16 | */ |
||
17 | private $client; |
||
18 | |||
19 | /** |
||
20 | * @var array |
||
21 | */ |
||
22 | private $options = []; |
||
23 | |||
24 | /** |
||
25 | */ |
||
26 | public function __construct() |
||
32 | ] |
||
33 | ]; |
||
34 | } |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * @return array |
||
39 | */ |
||
40 | public function getTeams() : array |
||
46 | ); |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * @return array |
||
51 | */ |
||
52 | public function getGames() : array |
||
53 | { |
||
54 | $res = $this->getClient()->get(self::GAMES, $this->options); |
||
55 | return (array)json_decode( |
||
56 | (string)$res->getBody()->getContents(), |
||
57 | true |
||
58 | ); |
||
59 | } |
||
60 | |||
61 | /** |
||
62 | * @return GuzzleHttpClient |
||
63 | */ |
||
64 | private function getClient() |
||
72 | } |
||
73 | } |