| Total Complexity | 5 |
| Total Lines | 53 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| 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 SleeperException |
||
| 14 | */ |
||
| 15 | public function byUser(string $userId, string $season, string $sport = 'nfl'): array |
||
| 16 | { |
||
| 17 | return $this->get('user/' . $userId . '/leagues/'. $sport .'/' . $season); |
||
| 18 | } |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @param string $leagueId |
||
| 22 | * @return array|[] |
||
| 23 | * @throws SleeperException |
||
| 24 | */ |
||
| 25 | public function byLeague(string $leagueId): array |
||
| 26 | { |
||
| 27 | return $this->get('league/'. $leagueId .'/drafts'); |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @param string $draftId |
||
| 32 | * @return array|[] |
||
| 33 | * @throws SleeperException |
||
| 34 | */ |
||
| 35 | public function find(string $draftId): array |
||
| 36 | { |
||
| 37 | return $this->get('/draft/' . $draftId); |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @param string $draftId |
||
| 42 | * @return array|[] |
||
| 43 | * @throws SleeperException |
||
| 44 | */ |
||
| 45 | public function picks(string $draftId): array |
||
| 46 | { |
||
| 47 | return $this->get('/draft/' . $draftId .'/picks'); |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @param string $draftId |
||
| 52 | * @return array|[] |
||
| 53 | * @throws SleeperException |
||
| 54 | */ |
||
| 55 | public function tradedPicks(string $draftId): array |
||
| 58 | } |
||
| 59 | |||
| 60 | } |
||
| 61 |