Passed
Push — master ( b16a12...abed16 )
by Ax
09:12
created

Leagues   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 65
Duplicated Lines 0 %

Test Coverage

Coverage 16.66%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 65
ccs 2
cts 12
cp 0.1666
rs 10
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A matchups() 0 3 1
A state() 0 3 1
A byUser() 0 3 1
A users() 0 3 1
A find() 0 3 1
A rosters() 0 3 1
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 SleeperException
12
   */
13 1
  public function find(string $leagueId): array
14
  {
15 1
    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...
16
  }
17
18
  /**
19
   * @param string $userId
20
   * @param string $season
21
   * @param string[optional] $sport default is nfl
22
   * @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...
23
   * @throws SleeperException
24
   */
25
  public function byUser(string $userId, string $season, string $sport = 'nfl'): array
26
  {
27
    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...
28
  }
29
30
31
  /**
32
   * @param string $leagueId
33
   * @param string $week
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 SleeperException
36
   */
37
  public function matchups(string $userId, string $week): array
0 ignored issues
show
Unused Code introduced by
The parameter $userId is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

37
  public function matchups(/** @scrutinizer ignore-unused */ string $userId, string $week): array

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
38
  {
39
    return $this->get('league/' . $leagueId . '/matchups/' . $week);
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $leagueId seems to be never defined.
Loading history...
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...
40
  }
41
42
  /**
43
   * @param string[optional] $sport default is nfl
44
   * @return object
45
   * @throws SleeperException
46
   */
47
  public function state(string $sport = 'nfl'): array
48
  {
49
    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...
50
  }
51
52
  /**
53
   * @param string $leagueId
54
   * @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...
55
   * @throws SleeperException
56
   */
57
  public function users(string $leagueId): array
58
  {
59
    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...
60
  }
61
62
  /**
63
   * @param string $leagueId
64
   * @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...
65
   * @throws SleeperException
66
   */
67
  public function rosters(string $leagueId): array
68
  {
69
    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...
70
  }
71
72
}
73