Total Complexity | 5 |
Total Lines | 58 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | class Drafts extends Api |
||
6 | { |
||
7 | |||
8 | /** |
||
9 | * @param string $userId |
||
10 | * @param string $season |
||
11 | * @param string[optional] $sport default is nfl |
||
12 | * @return array|[] |
||
|
|||
13 | * @throws ClientException if status code <> 200 |
||
14 | * @throws Exception if response body equals null |
||
15 | */ |
||
16 | 1 | public function byUser(string $userId, string $season, string $sport = 'nfl'): array |
|
17 | { |
||
18 | 1 | return $this->get('user/' . $userId . '/leagues/'. $sport .'/' . $season); |
|
19 | } |
||
20 | |||
21 | /** |
||
22 | * @param string $leagueId |
||
23 | * @return array|[] |
||
24 | * @throws ClientException if status code <> 200 |
||
25 | * @throws Exception if response body equals null |
||
26 | */ |
||
27 | 1 | public function byLeague(string $leagueId): array |
|
28 | { |
||
29 | 1 | return $this->get('league/'. $leagueId .'/drafts'); |
|
30 | } |
||
31 | |||
32 | /** |
||
33 | * @param string $draftId |
||
34 | * @return array|[] |
||
35 | * @throws ClientException if status code <> 200 |
||
36 | * @throws Exception if response body equals null |
||
37 | */ |
||
38 | 1 | public function find(string $draftId): array |
|
39 | { |
||
40 | 1 | return $this->get('/draft/' . $draftId); |
|
41 | } |
||
42 | |||
43 | /** |
||
44 | * @param string $draftId |
||
45 | * @return array|[] |
||
46 | * @throws ClientException if status code <> 200 |
||
47 | * @throws Exception if response body equals null |
||
48 | */ |
||
49 | 1 | public function picks(string $draftId): array |
|
50 | { |
||
51 | 1 | return $this->get('/draft/' . $draftId .'/picks'); |
|
52 | } |
||
53 | |||
54 | /** |
||
55 | * @param string $draftId |
||
56 | * @return array|[] |
||
57 | * @throws ClientException if status code <> 200 |
||
58 | * @throws Exception if response body equals null |
||
59 | */ |
||
60 | 1 | public function tradedPicks(string $draftId): array |
|
63 | } |
||
64 | |||
65 | } |
||
66 |