@@ -16,7 +16,11 @@ public function item(int $itemId, array $servers = [], string $dc = '')
1616 }
1717
1818 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 ' );
2024 }
2125
2226 return Guzzle::get ("/market/item/ {$ itemId }" , [
@@ -36,14 +40,13 @@ public function categories()
3640 return Guzzle::get ("/market/categories " );
3741 }
3842
39-
4043 public function itemPrices (string $ accessKey , int $ itemId , string $ server )
4144 {
4245 return Guzzle::get ("/private/market/item " , [
4346 RequestOptions::QUERY => [
4447 'companion_access_key ' => $ accessKey ,
45- 'item_id ' => $ itemId ,
46- 'server ' => $ server ,
48+ 'item_id ' => $ itemId ,
49+ 'server ' => $ server ,
4750 ]
4851 ]);
4952 }
@@ -53,8 +56,8 @@ public function itemHistory(string $accessKey, int $itemId, string $server)
5356 return Guzzle::get ("/private/market/item/history " , [
5457 RequestOptions::QUERY => [
5558 'companion_access_key ' => $ accessKey ,
56- 'item_id ' => $ itemId ,
57- 'server ' => $ server ,
59+ 'item_id ' => $ itemId ,
60+ 'server ' => $ server ,
5861 ]
5962 ]);
6063 }
@@ -64,8 +67,8 @@ public function manualUpdateItem(string $accessKey, int $itemId, string $server)
6467 return Guzzle::get ("/private/market/item/update " , [
6568 RequestOptions::QUERY => [
6669 'companion_access_key ' => $ accessKey ,
67- 'item_id ' => $ itemId ,
68- 'server ' => $ server ,
70+ 'item_id ' => $ itemId ,
71+ 'server ' => $ server ,
6972 ]
7073 ]);
7174 }
0 commit comments