@@ -16,7 +16,11 @@ public function item(int $itemId, array $servers = [], string $dc = '')
16
16
}
17
17
18
18
if ($ dc ) {
19
- $ options ['dc ' ] = $ dc
19
+ $ options ['dc ' ] = $ dc ;
20
+ }
21
+
22
+ if (empty ($ servers ) && empty ($ dc )) {
23
+ throw new \Exception ('You must provide either a list of servers or a DC name ' );
20
24
}
21
25
22
26
return Guzzle::get ("/market/item/ {$ itemId }" , [
@@ -36,14 +40,13 @@ public function categories()
36
40
return Guzzle::get ("/market/categories " );
37
41
}
38
42
39
-
40
43
public function itemPrices (string $ accessKey , int $ itemId , string $ server )
41
44
{
42
45
return Guzzle::get ("/private/market/item " , [
43
46
RequestOptions::QUERY => [
44
47
'companion_access_key ' => $ accessKey ,
45
- 'item_id ' => $ itemId ,
46
- 'server ' => $ server ,
48
+ 'item_id ' => $ itemId ,
49
+ 'server ' => $ server ,
47
50
]
48
51
]);
49
52
}
@@ -53,8 +56,8 @@ public function itemHistory(string $accessKey, int $itemId, string $server)
53
56
return Guzzle::get ("/private/market/item/history " , [
54
57
RequestOptions::QUERY => [
55
58
'companion_access_key ' => $ accessKey ,
56
- 'item_id ' => $ itemId ,
57
- 'server ' => $ server ,
59
+ 'item_id ' => $ itemId ,
60
+ 'server ' => $ server ,
58
61
]
59
62
]);
60
63
}
@@ -64,8 +67,8 @@ public function manualUpdateItem(string $accessKey, int $itemId, string $server)
64
67
return Guzzle::get ("/private/market/item/update " , [
65
68
RequestOptions::QUERY => [
66
69
'companion_access_key ' => $ accessKey ,
67
- 'item_id ' => $ itemId ,
68
- 'server ' => $ server ,
70
+ 'item_id ' => $ itemId ,
71
+ 'server ' => $ server ,
69
72
]
70
73
]);
71
74
}
0 commit comments