Passed
Push — master ( cde57f...1186c1 )
by Ax
02:14 queued 29s
created

Drafts::find()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace SchoppAx\Sleeper\Api;
4
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|[]
0 ignored issues
show
Documentation Bug introduced by
The doc comment array|[] at position 2 could not be parsed: Unknown type name '[' at position 2 in array|[].
Loading history...
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);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->get('user/...$sport . '/' . $season) returns the type SchoppAx\Sleeper\Api\json which is incompatible with the type-hinted return array.
Loading history...
19
  }
20
21
  /**
22
   * @param string $leagueId
23
   * @return array|[]
0 ignored issues
show
Documentation Bug introduced by
The doc comment array|[] at position 2 could not be parsed: Unknown type name '[' at position 2 in array|[].
Loading history...
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');
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->get('leagu... $leagueId . '/drafts') returns the type SchoppAx\Sleeper\Api\json which is incompatible with the type-hinted return array.
Loading history...
30
  }
31
32
  /**
33
   * @param string $draftId
34
   * @return array|[]
0 ignored issues
show
Documentation Bug introduced by
The doc comment array|[] at position 2 could not be parsed: Unknown type name '[' at position 2 in array|[].
Loading history...
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);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->get('/draft/' . $draftId) returns the type SchoppAx\Sleeper\Api\json which is incompatible with the type-hinted return array.
Loading history...
41
  }
42
43
  /**
44
   * @param string $draftId
45
   * @return array|[]
0 ignored issues
show
Documentation Bug introduced by
The doc comment array|[] at position 2 could not be parsed: Unknown type name '[' at position 2 in array|[].
Loading history...
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');
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->get('/draf... . $draftId . '/picks') returns the type SchoppAx\Sleeper\Api\json which is incompatible with the type-hinted return array.
Loading history...
52
  }
53
54
  /**
55
   * @param string $draftId
56
   * @return array|[]
0 ignored issues
show
Documentation Bug introduced by
The doc comment array|[] at position 2 could not be parsed: Unknown type name '[' at position 2 in array|[].
Loading history...
57
   * @throws ClientException if status code <> 200
58
   * @throws Exception if response body equals null
59
   */
60 1
  public function tradedPicks(string $draftId): array
61
  {
62 1
    return $this->get('/draft/' . $draftId .'/traded_picks');
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->get('/draf...ftId . '/traded_picks') returns the type SchoppAx\Sleeper\Api\json which is incompatible with the type-hinted return array.
Loading history...
63
  }
64
65
}
66