@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | /** |
14 | 14 | * @var Ecode[] |
15 | 15 | */ |
16 | - protected array $e_codes = []; |
|
16 | + protected array $e_codes = [ ]; |
|
17 | 17 | protected string $error_code; |
18 | 18 | protected string $error_details; |
19 | 19 | protected string $error_string; |
@@ -49,10 +49,10 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function setECodes(array $e_codes): void |
51 | 51 | { |
52 | - $this->e_codes = []; |
|
52 | + $this->e_codes = [ ]; |
|
53 | 53 | |
54 | 54 | foreach ($e_codes as $e_code) { |
55 | - $this->e_codes[] = new Ecode($e_code); |
|
55 | + $this->e_codes[ ] = new Ecode($e_code); |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | public function authentication(): AuthResponse |
64 | 64 | { |
65 | 65 | $response = $this->getHttpClient()->get($this->getEndpoint() . '/auth', [ |
66 | - 'auth' => [$this->user_id, $this->api_key] |
|
66 | + 'auth' => [ $this->user_id, $this->api_key ] |
|
67 | 67 | ]); |
68 | 68 | |
69 | 69 | return new AuthResponse(json_decode($response->getBody(), true)); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | if ( |
75 | 75 | !in_array( |
76 | 76 | $currency_code, |
77 | - ['AUD', 'CAD', 'CHF', 'CZK', 'DKK', 'EUR', 'GBP', 'HUF', 'NOK', 'NZD', 'PLN', 'SEK', 'USD'] |
|
77 | + [ 'AUD', 'CAD', 'CHF', 'CZK', 'DKK', 'EUR', 'GBP', 'HUF', 'NOK', 'NZD', 'PLN', 'SEK', 'USD' ] |
|
78 | 78 | ) |
79 | 79 | ) { |
80 | 80 | // Murder a kitten... |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | } |
83 | 83 | |
84 | 84 | $response = $this->getHttpClient()->get($this->getEndpoint() . '/balance/' . $currency_code, [ |
85 | - 'auth' => [$this->user_id, $this->api_key] |
|
85 | + 'auth' => [ $this->user_id, $this->api_key ] |
|
86 | 86 | ]); |
87 | 87 | |
88 | 88 | return new Balance(json_decode($response->getBody(), true)); |
@@ -99,11 +99,11 @@ discard block |
||
99 | 99 | public function listAllProducts(): Generator |
100 | 100 | { |
101 | 101 | $response = $this->getHttpClient()->get($this->getEndpoint() . '/products', [ |
102 | - 'auth' => [$this->user_id, $this->api_key] |
|
102 | + 'auth' => [ $this->user_id, $this->api_key ] |
|
103 | 103 | ]); |
104 | 104 | |
105 | 105 | $json = json_decode($response->getBody(), true); |
106 | - foreach ($json['products'] as $product) { |
|
106 | + foreach ($json[ 'products' ] as $product) { |
|
107 | 107 | yield new Product($product); |
108 | 108 | } |
109 | 109 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | public function findAProduct($productCode): Product |
112 | 112 | { |
113 | 113 | $response = $this->getHttpClient()->get($this->getEndpoint() . '/products/' . $productCode, [ |
114 | - 'auth' => [$this->user_id, $this->api_key] |
|
114 | + 'auth' => [ $this->user_id, $this->api_key ] |
|
115 | 115 | ]); |
116 | 116 | |
117 | 117 | return new Product(json_decode($response->getBody(), true)); |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | 'headers' => [ |
124 | 124 | 'content-type' => 'application/json', |
125 | 125 | ], |
126 | - 'auth' => [$this->user_id, $this->api_key], |
|
126 | + 'auth' => [ $this->user_id, $this->api_key ], |
|
127 | 127 | 'body' => json_encode($orderRequest) |
128 | 128 | ]); |
129 | 129 |