1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace BlizzardApi\Service; |
4
|
|
|
|
5
|
|
|
use GuzzleHttp\Psr7\Response; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* Class World Of Warcraft |
9
|
|
|
* |
10
|
|
|
* @author Oleg Kachinsky <[email protected]> |
11
|
|
|
*/ |
12
|
|
|
class WorldOfWarcraft extends Service |
13
|
|
|
{ |
14
|
|
|
/** |
15
|
|
|
* {@inheritdoc} |
16
|
|
|
*/ |
17
|
|
|
protected $serviceParam = '/wow'; |
18
|
|
|
|
19
|
|
|
// region Achievement API |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* Get achievement information by ID |
23
|
|
|
* |
24
|
|
|
* This provides data about an individual achievement |
25
|
|
|
* |
26
|
|
|
* @param int $achievementId The ID of the achievement to retrieve |
27
|
|
|
* @param array $options Options |
28
|
|
|
* |
29
|
|
|
* @return Response |
30
|
|
|
*/ |
31
|
|
|
public function getAchievement($achievementId, array $options = []) |
32
|
|
|
{ |
33
|
|
|
return $this->request('/achievement/'.(int) $achievementId, $options); |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
// endregion Achievement API |
37
|
|
|
|
38
|
|
|
// region Auction API |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* Get auction data status |
42
|
|
|
* |
43
|
|
|
* Auction APIs currently provide rolling batches of data about current auctions. Fetching auction dumps is a two |
44
|
|
|
* step process that involves checking a per-realm index file to determine if a recent dump has been generated and |
45
|
|
|
* then fetching the most recently generated dump file if necessary. |
46
|
|
|
* |
47
|
|
|
* This API resource provides a per-realm list of recently generated auction house data dumps |
48
|
|
|
* |
49
|
|
|
* @param string $realm The realm being requested |
50
|
|
|
* @param array $options Options |
51
|
|
|
* |
52
|
|
|
* @return Response |
53
|
|
|
*/ |
54
|
|
|
public function getAuctionDataStatus($realm, array $options = []) |
55
|
|
|
{ |
56
|
|
|
return $this->request('/auction/data/'.(string) $realm, $options); |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
// endregion Auction API |
60
|
|
|
|
61
|
|
|
// region Boss API |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* Get boss master list |
65
|
|
|
* |
66
|
|
|
* A list of all supported bosses. A 'boss' in this context should be considered a boss encounter, which may include |
67
|
|
|
* more than one NPC. |
68
|
|
|
* |
69
|
|
|
* @param array $options Options |
70
|
|
|
* |
71
|
|
|
* @return Response |
72
|
|
|
*/ |
73
|
|
|
public function getBossMasterList(array $options = []) |
74
|
|
|
{ |
75
|
|
|
return $this->request('/boss/', $options); |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* Get boss information by ID |
80
|
|
|
* |
81
|
|
|
* The boss API provides information about bosses. A 'boss' in this context should be considered a boss encounter, |
82
|
|
|
* which may include more than one NPC. |
83
|
|
|
* |
84
|
|
|
* @param int $bossId The ID of the boss you want to retrieve |
85
|
|
|
* @param array $options Options |
86
|
|
|
* |
87
|
|
|
* @return Response |
88
|
|
|
*/ |
89
|
|
|
public function getBoss($bossId, array $options = []) |
90
|
|
|
{ |
91
|
|
|
return $this->request('/boss/'.(int) $bossId, $options); |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
// endregion Boss API |
95
|
|
|
|
96
|
|
|
// region Challenge Mode API |
97
|
|
|
|
98
|
|
|
/** |
99
|
|
|
* Get realm leaderboards |
100
|
|
|
* |
101
|
|
|
* The data in this request has data for all 9 challenge mode maps (currently). The map field includes the current |
102
|
|
|
* medal times for each dungeon. Inside each ladder we provide data about each character that was part of each run. |
103
|
|
|
* The character data includes the current cached spec of the character while the member field includes the spec of |
104
|
|
|
* the character during the challenge mode run. |
105
|
|
|
* |
106
|
|
|
* @param string $realm The realm being requested |
107
|
|
|
* @param array $options Options |
108
|
|
|
* |
109
|
|
|
* @return Response |
110
|
|
|
*/ |
111
|
|
|
public function getRealmLeaderboard($realm, array $options = []) |
112
|
|
|
{ |
113
|
|
|
return $this->request('/challenge/'.(string) $realm, $options); |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
/** |
117
|
|
|
* Get region leaderboards |
118
|
|
|
* |
119
|
|
|
* The region leaderboard has the exact same data format as the realm leaderboards except there is no realm field. |
120
|
|
|
* It is simply the top 100 results gathered for each map for all of the available realm leaderboards in a region. |
121
|
|
|
* |
122
|
|
|
* @param array $options Options |
123
|
|
|
* |
124
|
|
|
* @return Response |
125
|
|
|
*/ |
126
|
|
|
public function getRegionLeaderboard(array $options = []) |
127
|
|
|
{ |
128
|
|
|
return $this->request('/challenge/region/', $options); |
129
|
|
|
} |
130
|
|
|
|
131
|
|
|
// endregion Challenge Mode API |
132
|
|
|
|
133
|
|
|
// region Character profile API |
134
|
|
|
|
135
|
|
|
/** |
136
|
|
|
* Get character |
137
|
|
|
* |
138
|
|
|
* The Character Profile API is the primary way to access character information. This Character Profile API can be |
139
|
|
|
* used to fetch a single character at a time through an HTTP GET request to a URL describing the character profile |
140
|
|
|
* resource. By default, a basic dataset will be returned and with each request and zero or more additional fields |
141
|
|
|
* can be retrieved. To access this API, craft a resource URL pointing to the character who's information is to be |
142
|
|
|
* retrieved |
143
|
|
|
* |
144
|
|
|
* @param string $realm The character's realm. Can be provided as the proper realm name or the normalized realm name |
145
|
|
|
* @param string $characterName The name of the character you want to retrieve |
146
|
|
|
* @param array $options Options |
147
|
|
|
* |
148
|
|
|
* @return Response |
149
|
|
|
*/ |
150
|
|
|
public function getCharacter($realm, $characterName, array $options = []) |
151
|
|
|
{ |
152
|
|
|
return $this->request('/character/'.(string) $realm.'/'.(string) $characterName, $options); |
153
|
|
|
} |
154
|
|
|
|
155
|
|
|
// endregion Character profile API |
156
|
|
|
|
157
|
|
|
// region Guild profile API |
158
|
|
|
|
159
|
|
|
/** |
160
|
|
|
* Get guild profile |
161
|
|
|
* |
162
|
|
|
* The guild profile API is the primary way to access guild information. This guild profile API can be used to fetch |
163
|
|
|
* a single guild at a time through an HTTP GET request to a url describing the guild profile resource. By default, |
164
|
|
|
* a basic dataset will be returned and with each request and zero or more additional fields can be retrieved. |
165
|
|
|
* |
166
|
|
|
* There are no required query string parameters when accessing this resource, although the fields query string |
167
|
|
|
* parameter can optionally be passed to indicate that one or more of the optional datasets is to be retrieved. |
168
|
|
|
* Those additional fields are listed in the method titled "Optional Fields". |
169
|
|
|
* |
170
|
|
|
* @param string $realm The realm the guild lives on |
171
|
|
|
* @param string $guildName Name of the guild being queried |
172
|
|
|
* @param array $options Options |
173
|
|
|
* |
174
|
|
|
* @return Response |
175
|
|
|
*/ |
176
|
|
|
public function getGuild($realm, $guildName, array $options = []) |
177
|
|
|
{ |
178
|
|
|
return $this->request('/guild/'.(string) $realm.'/'.(string) $guildName, $options); |
179
|
|
|
} |
180
|
|
|
|
181
|
|
|
// endregion Guild profile API |
182
|
|
|
|
183
|
|
|
// region Item API |
184
|
|
|
|
185
|
|
|
/** |
186
|
|
|
* Get item information by ID |
187
|
|
|
* |
188
|
|
|
* The item API provides detailed item information. This includes item set information if this item is part of a set. |
189
|
|
|
* |
190
|
|
|
* @param int $itemId Unique ID of the item being requested |
191
|
|
|
* @param array $options Options |
192
|
|
|
* |
193
|
|
|
* @return Response |
194
|
|
|
*/ |
195
|
|
|
public function getItem($itemId, array $options = []) |
196
|
|
|
{ |
197
|
|
|
return $this->request('/item/'.(int) $itemId, $options); |
198
|
|
|
} |
199
|
|
|
|
200
|
|
|
/** |
201
|
|
|
* Get set information by ID |
202
|
|
|
* |
203
|
|
|
* The item API provides detailed item information. This includes item set information if this item is part of a set. |
204
|
|
|
* |
205
|
|
|
* @param int $setId Unique ID of the set being requested |
206
|
|
|
* @param array $options Options |
207
|
|
|
* |
208
|
|
|
* @return Response |
209
|
|
|
*/ |
210
|
|
|
public function getItemSet($setId, array $options = []) |
211
|
|
|
{ |
212
|
|
|
return $this->request('/item/set/'.(int) $setId, $options); |
213
|
|
|
} |
214
|
|
|
|
215
|
|
|
// endregion Item API |
216
|
|
|
|
217
|
|
|
// region Mount API |
218
|
|
|
|
219
|
|
|
/** |
220
|
|
|
* Get mount master list |
221
|
|
|
* |
222
|
|
|
* A list of all supported mounts |
223
|
|
|
* |
224
|
|
|
* @param array $options Options |
225
|
|
|
* |
226
|
|
|
* @return Response |
227
|
|
|
*/ |
228
|
|
|
public function getMountMasterList(array $options = []) |
229
|
|
|
{ |
230
|
|
|
return $this->request('/mount/', $options); |
231
|
|
|
} |
232
|
|
|
|
233
|
|
|
// endregion Mount API |
234
|
|
|
|
235
|
|
|
// region Pet API |
236
|
|
|
|
237
|
|
|
/** |
238
|
|
|
* Get pet lists |
239
|
|
|
* |
240
|
|
|
* A list of all supported battle and vanity pets |
241
|
|
|
* |
242
|
|
|
* @param array $options Options |
243
|
|
|
* |
244
|
|
|
* @return Response |
245
|
|
|
*/ |
246
|
|
|
public function getPetList(array $options = []) |
247
|
|
|
{ |
248
|
|
|
return $this->request('/pet/', $options); |
249
|
|
|
} |
250
|
|
|
|
251
|
|
|
/** |
252
|
|
|
* Get pet ability information by ID |
253
|
|
|
* |
254
|
|
|
* This provides data about a individual battle pet ability ID. We do not provide the tooltip for the ability yet. |
255
|
|
|
* We are working on a better way to provide this since it depends on your pet's species, level and quality rolls. |
256
|
|
|
* |
257
|
|
|
* @param int $abilityId The ID of the ability you want to retrieve |
258
|
|
|
* @param array $options Options |
259
|
|
|
* |
260
|
|
|
* @return Response |
261
|
|
|
*/ |
262
|
|
|
public function getPetAbility($abilityId, array $options = []) |
263
|
|
|
{ |
264
|
|
|
return $this->request('/pet/ability/'.(int) $abilityId, $options); |
265
|
|
|
} |
266
|
|
|
|
267
|
|
|
/** |
268
|
|
|
* Get pet species information by ID |
269
|
|
|
* |
270
|
|
|
* This provides the data about an individual pet species. The species IDs can be found your character profile |
271
|
|
|
* using the options pets field. Each species also has data about what it's 6 abilities are. |
272
|
|
|
* |
273
|
|
|
* @param int $speciesId The species you want to retrieve data on |
274
|
|
|
* @param array $options Options |
275
|
|
|
* |
276
|
|
|
* @return Response |
277
|
|
|
*/ |
278
|
|
|
public function getPetSpecies($speciesId, array $options = []) |
279
|
|
|
{ |
280
|
|
|
return $this->request('/pet/species/'.(int) $speciesId, $options); |
281
|
|
|
} |
282
|
|
|
|
283
|
|
|
/** |
284
|
|
|
* Get pet stats by species ID |
285
|
|
|
* |
286
|
|
|
* Retrieve detailed information about a given species of pet |
287
|
|
|
* |
288
|
|
|
* @param int $speciesId The pet's species ID. This can be found by querying a users' list of pets via the Character Profile API |
289
|
|
|
* @param array $options Options |
290
|
|
|
* |
291
|
|
|
* @return Response |
292
|
|
|
*/ |
293
|
|
|
public function getPetStats($speciesId, array $options = []) |
294
|
|
|
{ |
295
|
|
|
return $this->request('/pet/stats/'.(int) $speciesId, $options); |
296
|
|
|
} |
297
|
|
|
|
298
|
|
|
// endregion Pet API |
299
|
|
|
|
300
|
|
|
// region PVP API |
301
|
|
|
|
302
|
|
|
/** |
303
|
|
|
* Get leaderboards |
304
|
|
|
* |
305
|
|
|
* The Leaderboard API endpoint provides leaderboard information for the 2v2, 3v3, 5v5 and Rated Battleground |
306
|
|
|
* leaderboards. |
307
|
|
|
* |
308
|
|
|
* @param int $bracket The type of leaderboard you want to retrieve. Valid entries are 2v2, 3v3, 5v5, and rbg |
309
|
|
|
* @param array $options Options |
310
|
|
|
* |
311
|
|
|
* @return Response |
312
|
|
|
*/ |
313
|
|
|
public function getLeaderboards($bracket, array $options = []) |
314
|
|
|
{ |
315
|
|
|
return $this->request('/leaderboard/'.(string) $bracket, $options); |
316
|
|
|
} |
317
|
|
|
|
318
|
|
|
// endregion PVP API |
319
|
|
|
|
320
|
|
|
// region Quest API |
321
|
|
|
|
322
|
|
|
/** |
323
|
|
|
* Get quest information by ID |
324
|
|
|
* |
325
|
|
|
* Retrieve metadata for a given quest. |
326
|
|
|
* |
327
|
|
|
* @param int $questId The ID of the desired quest |
328
|
|
|
* @param array $options Options |
329
|
|
|
* |
330
|
|
|
* @return Response |
331
|
|
|
*/ |
332
|
|
|
public function getQuest($questId, array $options = []) |
333
|
|
|
{ |
334
|
|
|
return $this->request('/quest/'.(int) $questId, $options); |
335
|
|
|
} |
336
|
|
|
|
337
|
|
|
// endregion Quest API |
338
|
|
|
|
339
|
|
|
// region Realm status API |
340
|
|
|
|
341
|
|
|
/** |
342
|
|
|
* Get realm status |
343
|
|
|
* |
344
|
|
|
* The realm status API allows developers to retrieve realm status information. This information is limited to |
345
|
|
|
* whether or not the realm is up, the type and state of the realm, the current population, and the status of the |
346
|
|
|
* two world PvP zones |
347
|
|
|
* |
348
|
|
|
* @param array $options Options |
349
|
|
|
* |
350
|
|
|
* @return Response |
351
|
|
|
*/ |
352
|
|
|
public function getRealmStatus(array $options = []) |
353
|
|
|
{ |
354
|
|
|
return $this->request('/realm/', $options); |
355
|
|
|
} |
356
|
|
|
|
357
|
|
|
// endregion Realm status API |
358
|
|
|
|
359
|
|
|
// region Recipe API |
360
|
|
|
|
361
|
|
|
/** |
362
|
|
|
* Get recipe information by ID |
363
|
|
|
* |
364
|
|
|
* The recipe API provides basic recipe information |
365
|
|
|
* |
366
|
|
|
* @param int $recipeId Unique ID for the desired recipe |
367
|
|
|
* @param array $options Options |
368
|
|
|
* |
369
|
|
|
* @return Response |
370
|
|
|
*/ |
371
|
|
|
public function getRecipe($recipeId, array $options = []) |
372
|
|
|
{ |
373
|
|
|
return $this->request('/recipe/'.(int) $recipeId, $options); |
374
|
|
|
} |
375
|
|
|
|
376
|
|
|
// endregion Recipe API |
377
|
|
|
|
378
|
|
|
// region Spell API |
379
|
|
|
|
380
|
|
|
/** |
381
|
|
|
* Get spell information by ID |
382
|
|
|
* |
383
|
|
|
* The spell API provides some information about spells |
384
|
|
|
* |
385
|
|
|
* @param int $spellId Unique ID of the desired spell |
386
|
|
|
* @param array $options Options |
387
|
|
|
* |
388
|
|
|
* @return Response |
389
|
|
|
*/ |
390
|
|
|
public function getSpell($spellId, array $options = []) |
391
|
|
|
{ |
392
|
|
|
return $this->request('/spell/'.(int) $spellId, $options); |
393
|
|
|
} |
394
|
|
|
|
395
|
|
|
// endregion Spell API |
396
|
|
|
|
397
|
|
|
// region Zone API |
398
|
|
|
|
399
|
|
|
/** |
400
|
|
|
* Get zone master list |
401
|
|
|
* |
402
|
|
|
* A list of all supported zones and their bosses. A 'zone' in this context should be considered a dungeon, or a |
403
|
|
|
* raid, not a zone as in a world zone. A 'boss' in this context should be considered a boss encounter, which may |
404
|
|
|
* include more than one NPC. |
405
|
|
|
* |
406
|
|
|
* @param array $options Options |
407
|
|
|
* |
408
|
|
|
* @return Response |
409
|
|
|
*/ |
410
|
|
|
public function getZonesMasterList(array $options = []) |
411
|
|
|
{ |
412
|
|
|
return $this->request('/zone/', $options); |
413
|
|
|
} |
414
|
|
|
|
415
|
|
|
/** |
416
|
|
|
* Get zone information by ID |
417
|
|
|
* |
418
|
|
|
* The Zone API provides some information about zones. |
419
|
|
|
* |
420
|
|
|
* @param int $zoneId The ID of the zone you want to retrieve |
421
|
|
|
* @param array $options Options |
422
|
|
|
* |
423
|
|
|
* @return Response |
424
|
|
|
*/ |
425
|
|
|
public function getZone($zoneId, array $options = []) |
426
|
|
|
{ |
427
|
|
|
return $this->request('/zone/'.(int) $zoneId, $options); |
428
|
|
|
} |
429
|
|
|
|
430
|
|
|
// endregion Zone API |
431
|
|
|
|
432
|
|
|
// region Data resources API |
433
|
|
|
|
434
|
|
|
/** |
435
|
|
|
* Get battlegroups |
436
|
|
|
* |
437
|
|
|
* The battlegroups data API provides the list of battlegroups for this region. Please note the trailing '/' on this URL |
438
|
|
|
* |
439
|
|
|
* @param array $options Options |
440
|
|
|
* |
441
|
|
|
* @return Response |
442
|
|
|
*/ |
443
|
|
|
public function getBattlegroups(array $options = []) |
444
|
|
|
{ |
445
|
|
|
return $this->request('/data/battlegroups/', $options); |
446
|
|
|
} |
447
|
|
|
|
448
|
|
|
/** |
449
|
|
|
* Get character races |
450
|
|
|
* |
451
|
|
|
* The character races data API provides a list of each race and their associated faction, name, unique ID, and skin |
452
|
|
|
* |
453
|
|
|
* @param array $options Options |
454
|
|
|
* |
455
|
|
|
* @return Response |
456
|
|
|
*/ |
457
|
|
|
public function getCharacterRaces(array $options = []) |
458
|
|
|
{ |
459
|
|
|
return $this->request('/data/character/races/', $options); |
460
|
|
|
} |
461
|
|
|
|
462
|
|
|
/** |
463
|
|
|
* Get character classes |
464
|
|
|
* |
465
|
|
|
* The character classes data API provides a list of character classes |
466
|
|
|
* |
467
|
|
|
* @param array $options Options |
468
|
|
|
* |
469
|
|
|
* @return Response |
470
|
|
|
*/ |
471
|
|
|
public function getCharacterClasses(array $options = []) |
472
|
|
|
{ |
473
|
|
|
return $this->request('/data/character/classes/', $options); |
474
|
|
|
} |
475
|
|
|
|
476
|
|
|
/** |
477
|
|
|
* Get character achievements |
478
|
|
|
* |
479
|
|
|
* The character achievements data API provides a list of all of the achievements that characters can earn as well |
480
|
|
|
* as the category structure and hierarchy |
481
|
|
|
* |
482
|
|
|
* @param array $options Options |
483
|
|
|
* |
484
|
|
|
* @return Response |
485
|
|
|
*/ |
486
|
|
|
public function getCharacterAchievements(array $options = []) |
487
|
|
|
{ |
488
|
|
|
return $this->request('/data/character/achievements/', $options); |
489
|
|
|
} |
490
|
|
|
|
491
|
|
|
/** |
492
|
|
|
* Get guild rewards |
493
|
|
|
* |
494
|
|
|
* The guild rewards data API provides a list of all guild rewards |
495
|
|
|
* |
496
|
|
|
* @param array $options Options |
497
|
|
|
* |
498
|
|
|
* @return Response |
499
|
|
|
*/ |
500
|
|
|
public function getGuildRewards(array $options = []) |
501
|
|
|
{ |
502
|
|
|
return $this->request('/data/guild/rewards/', $options); |
503
|
|
|
} |
504
|
|
|
|
505
|
|
|
/** |
506
|
|
|
* Get guild perks |
507
|
|
|
* |
508
|
|
|
* The guild perks data API provides a list of all guild perks |
509
|
|
|
* |
510
|
|
|
* @param array $options Options |
511
|
|
|
* |
512
|
|
|
* @return Response |
513
|
|
|
*/ |
514
|
|
|
public function getGuildPerks(array $options = []) |
515
|
|
|
{ |
516
|
|
|
return $this->request('/data/guild/perks/', $options); |
517
|
|
|
} |
518
|
|
|
|
519
|
|
|
/** |
520
|
|
|
* Get guild achievements |
521
|
|
|
* |
522
|
|
|
* The guild achievements data API provides a list of all of the achievements that guilds can earn as well as the |
523
|
|
|
* category structure and hierarchy |
524
|
|
|
* |
525
|
|
|
* @param array $options Options |
526
|
|
|
* |
527
|
|
|
* @return Response |
528
|
|
|
*/ |
529
|
|
|
public function getGuildAchievements(array $options = []) |
530
|
|
|
{ |
531
|
|
|
return $this->request('/data/guild/achievements/', $options); |
532
|
|
|
} |
533
|
|
|
|
534
|
|
|
/** |
535
|
|
|
* Get item classes |
536
|
|
|
* |
537
|
|
|
* The item classes data API provides a list of item classes |
538
|
|
|
* |
539
|
|
|
* @param array $options Options |
540
|
|
|
* |
541
|
|
|
* @return Response |
542
|
|
|
*/ |
543
|
|
|
public function getItemClasses(array $options = []) |
544
|
|
|
{ |
545
|
|
|
return $this->request('/data/item/classes/', $options); |
546
|
|
|
} |
547
|
|
|
|
548
|
|
|
/** |
549
|
|
|
* Get talents |
550
|
|
|
* |
551
|
|
|
* The talents data API provides a list of talents, specs and glyphs for each class |
552
|
|
|
* |
553
|
|
|
* @param array $options Options |
554
|
|
|
* |
555
|
|
|
* @return Response |
556
|
|
|
*/ |
557
|
|
|
public function getTalents(array $options = []) |
558
|
|
|
{ |
559
|
|
|
return $this->request('/data/talents/', $options); |
560
|
|
|
} |
561
|
|
|
|
562
|
|
|
/** |
563
|
|
|
* Get pet types |
564
|
|
|
* |
565
|
|
|
* The different bat pet types (including what they are strong and weak against) |
566
|
|
|
* |
567
|
|
|
* @param array $options Options |
568
|
|
|
* |
569
|
|
|
* @return Response |
570
|
|
|
*/ |
571
|
|
|
public function getPetTypes(array $options = []) |
572
|
|
|
{ |
573
|
|
|
return $this->request('/data/pet/types/', $options); |
574
|
|
|
} |
575
|
|
|
|
576
|
|
|
// endregion Data resources API |
577
|
|
|
|
578
|
|
|
// region Community OAuth API |
579
|
|
|
|
580
|
|
|
/** |
581
|
|
|
* Get profile characters |
582
|
|
|
* |
583
|
|
|
* This provides data about the current logged in OAuth user's WoW profile |
584
|
|
|
* |
585
|
|
|
* @param null|string $accessToken Authorized user access token |
586
|
|
|
* @param array $options Options |
587
|
|
|
* |
588
|
|
|
* @return Response |
589
|
|
|
*/ |
590
|
|
View Code Duplication |
public function getProfileCharacters($accessToken = null, array $options = []) |
|
|
|
|
591
|
|
|
{ |
592
|
|
|
if (null === $accessToken) { |
593
|
|
|
$options['access_token'] = $this->blizzardClient->getAccessToken(); |
594
|
|
|
} else { |
595
|
|
|
$options['access_token'] = $accessToken; |
596
|
|
|
} |
597
|
|
|
|
598
|
|
|
return $this->request('/user/characters', $options); |
599
|
|
|
} |
600
|
|
|
|
601
|
|
|
// endregion Community OAuth API |
602
|
|
|
} |
603
|
|
|
|
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.