1 | <?php |
||
18 | class Main |
||
19 | { |
||
20 | /** |
||
21 | * Guzzle Client variable to send all requests. |
||
22 | * |
||
23 | * @var object<GuzzleHttp\Client> |
||
24 | */ |
||
25 | private $client; |
||
26 | |||
27 | /** |
||
28 | * API Key of your development battlerite account. |
||
29 | * |
||
30 | * @var string |
||
31 | */ |
||
32 | private $apiKey; |
||
33 | |||
34 | /** |
||
35 | * @var \guastallaigor\PhpBattlerite\Config |
||
36 | */ |
||
37 | private $config; |
||
38 | |||
39 | /** |
||
40 | * Main constructor. |
||
41 | * |
||
42 | * @param \guastallaigor\PhpBattlerite\Config $config |
||
43 | */ |
||
44 | 4 | public function __construct(Config $config) |
|
49 | |||
50 | /** |
||
51 | * Method to set your API Key provided by your Battlerite development account. |
||
52 | * |
||
53 | * @param string $apiKey |
||
54 | * |
||
55 | * @return void |
||
56 | */ |
||
57 | 4 | public function setAPIKey($apiKey) |
|
61 | |||
62 | /** |
||
63 | * Function that is going to make all the requests you need. |
||
64 | * |
||
65 | * @param string $method |
||
66 | * @param string $request |
||
67 | * @param array $filter |
||
68 | * |
||
69 | * @return array |
||
70 | */ |
||
71 | 4 | public function sendRequest($method, $request, $filter = [], $global = true) |
|
98 | |||
99 | /** |
||
100 | * Get a single player request. |
||
101 | * |
||
102 | * @param string $id |
||
103 | * |
||
104 | * @return array |
||
105 | */ |
||
106 | 1 | public function getPlayer($id) |
|
110 | |||
111 | /** |
||
112 | * Get a collection of players. |
||
113 | * |
||
114 | * @param string $ids |
||
115 | * @param string $type |
||
116 | * |
||
117 | * @return array |
||
118 | */ |
||
119 | 1 | public function getPlayers($ids, $type = 'playerIds') |
|
125 | |||
126 | /** |
||
127 | * Get a collection of teams. |
||
128 | * |
||
129 | * @param array $filters |
||
|
|||
130 | * |
||
131 | * @return array |
||
132 | */ |
||
133 | public function getTeams($filter) |
||
138 | |||
139 | /** |
||
140 | * Get Battlerite status. |
||
141 | * |
||
142 | * @return array |
||
143 | */ |
||
144 | 1 | public function getStatus() |
|
148 | |||
149 | /** |
||
150 | * Get all the telemetry data. |
||
151 | * |
||
152 | * @param array $filters |
||
153 | * |
||
154 | * @return array |
||
155 | */ |
||
156 | 1 | public function getMatches($filters) |
|
171 | |||
172 | /** |
||
173 | * Function to handle unexpected errors. |
||
174 | * |
||
175 | * @param RequestException $error |
||
176 | * |
||
177 | * @return array |
||
178 | */ |
||
179 | protected function statusCodeHandling($error) |
||
186 | } |
||
187 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.
Consider the following example. The parameter
$ireland
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was changed, but the annotation was not.