Passed
Push — master ( cc57e4...8c3235 )
by Ax
07:11
created

Leagues::state()   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 Leagues extends Api
6
{
7
8
  /**
9
   * @param string $leagueId
10
   * @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...
11
   * @throws ClientException if status code <> 200
12
   * @throws Exception if response body equals null
13
   */
14 4
  public function find(string $leagueId): array
15
  {
16 4
    return $this->get('league/' . $leagueId);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->get('league/' . $leagueId) returns the type SchoppAx\Sleeper\Api\json which is incompatible with the type-hinted return array.
Loading history...
17
  }
18
19
  /**
20
   * @param string $userId
21
   * @param string $season
22
   * @param string[optional] $sport default is nfl
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 byUser(string $userId, string $season, string $sport = 'nfl'): array
28
  {
29 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...
30
  }
31
32
33
  /**
34
   * @param string $leagueId
35
   * @param string $week
36
   * @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...
37
   * @throws ClientException if status code <> 200
38
   * @throws Exception if response body equals null
39
   */
40 1
  public function matchups(string $leagueId, string $week): array
41
  {
42 1
    return $this->get('league/' . $leagueId . '/matchups/' . $week);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->get('leagu.... '/matchups/' . $week) returns the type SchoppAx\Sleeper\Api\json which is incompatible with the type-hinted return array.
Loading history...
43
  }
44
45
  /**
46
   * @param string[optional] $sport default is nfl
47
   * @return object
48
   * @throws ClientException if status code <> 200
49
   * @throws Exception if response body equals null
50
   */
51 1
  public function state(string $sport = 'nfl'): array
52
  {
53 1
    return $this->get('state/'. $sport);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->get('state/' . $sport) returns the type SchoppAx\Sleeper\Api\json which is incompatible with the type-hinted return array.
Loading history...
54
  }
55
56
  /**
57
   * @param string $leagueId
58
   * @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...
59
   * @throws ClientException if status code <> 200
60
   * @throws Exception if response body equals null
61
   */
62 1
  public function users(string $leagueId): array
63
  {
64 1
    return $this->get('league/' . $leagueId . '/users');
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->get('leagu.... $leagueId . '/users') returns the type SchoppAx\Sleeper\Api\json which is incompatible with the type-hinted return array.
Loading history...
65
  }
66
67
  /**
68
   * @param string $leagueId
69
   * @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...
70
   * @throws ClientException if status code <> 200
71
   * @throws Exception if response body equals null
72
   */
73 1
  public function rosters(string $leagueId): array
74
  {
75 1
    return $this->get('league/' . $leagueId . '/rosters');
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->get('leagu...$leagueId . '/rosters') returns the type SchoppAx\Sleeper\Api\json which is incompatible with the type-hinted return array.
Loading history...
76
  }
77
78
  /**
79
   * @param string $leagueId
80
   * @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...
81
   * @throws ClientException if status code <> 200
82
   * @throws Exception if response body equals null
83
   */
84
  public function winnersBracket(string $leagueId): array
85
  {
86
    return $this->get('league/' . $leagueId . '/winners_bracket');
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->get('leagu...d . '/winners_bracket') returns the type SchoppAx\Sleeper\Api\json which is incompatible with the type-hinted return array.
Loading history...
87
  }
88
89
  /**
90
   * @param string $leagueId
91
   * @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...
92
   * @throws ClientException if status code <> 200
93
   * @throws Exception if response body equals null
94
   */
95
  public function losersBracket(string $leagueId): array
96
  {
97
    return $this->get('league/' . $leagueId . '/losers_bracket');
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->get('leagu...Id . '/losers_bracket') returns the type SchoppAx\Sleeper\Api\json which is incompatible with the type-hinted return array.
Loading history...
98
  }
99
100
}
101