File tree Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -18,18 +18,13 @@ class Service
1818 */
1919 protected $ blizzardClient ;
2020
21- /**
22- * @var array $defaultOption Array of default options
23- */
24- protected $ defaultOption = [];
25-
2621 /**
2722 * @var string $serviceParam Service parameter
2823 */
2924 protected $ serviceParam ;
3025
3126 /**
32- * WorldOfWarcraft constructor
27+ * Service constructor
3328 *
3429 * @param BlizzardClient $blizzardClient Configured blizzard client
3530 */
@@ -50,11 +45,13 @@ public function __construct(BlizzardClient $blizzardClient)
5045 */
5146 protected function request ($ urlSuffix , array $ options )
5247 {
53- $ options = $ this ->generateQueryOptions ($ options );
48+ $ client = new Client ([
49+ 'base_uri ' => $ this ->blizzardClient ->getApiUrl (),
50+ ]);
5451
55- $ requestUrl = $ this ->blizzardClient -> getApiUrl (). $ this -> serviceParam . $ urlSuffix ;
52+ $ options = $ this ->generateQueryOptions ( $ options ) ;
5653
57- $ result = ( new Client ()) ->get ($ requestUrl , $ options );
54+ $ result = $ client ->get ($ this -> serviceParam . $ urlSuffix , $ options );
5855
5956 return $ result ;
6057 }
@@ -89,11 +86,9 @@ private function generateQueryOptions(array $options = [])
8986 */
9087 private function getDefaultOptions ()
9188 {
92- $ defaultOption = [
89+ return [
9390 'locale ' => $ this ->blizzardClient ->getLocale (),
9491 'apiKey ' => $ this ->blizzardClient ->getApiKey (),
9592 ];
96-
97- return $ defaultOption ;
9893 }
9994}
You can’t perform that action at this time.
0 commit comments