@@ -138,11 +138,11 @@ discard block |
||
138 | 138 | * |
139 | 139 | * @return $this |
140 | 140 | */ |
141 | - public function for(string $date) |
|
141 | + public function for (string $date) |
|
142 | 142 | { |
143 | 143 | $this->date = $date; |
144 | 144 | |
145 | - if (! isset($this->rates[$this->date])) { |
|
145 | + if (!isset($this->rates[$this->date])) { |
|
146 | 146 | $this->getRatesFromCBAR(); |
147 | 147 | } |
148 | 148 | |
@@ -161,12 +161,12 @@ discard block |
||
161 | 161 | */ |
162 | 162 | public function __get(string $currency) |
163 | 163 | { |
164 | - if (! isset($this->rates[$this->date])) { |
|
164 | + if (!isset($this->rates[$this->date])) { |
|
165 | 165 | $this->getRatesFromCBAR(); |
166 | 166 | } |
167 | 167 | |
168 | - if (! isset($this->rates[$this->date][$currency])) { |
|
169 | - throw new CurrencyException('Currency with ' . $currency . ' code is not available'); |
|
168 | + if (!isset($this->rates[$this->date][$currency])) { |
|
169 | + throw new CurrencyException('Currency with '.$currency.' code is not available'); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | if ($this->aznAmount) { |
@@ -192,12 +192,12 @@ discard block |
||
192 | 192 | */ |
193 | 193 | public function __call(string $currency, array $arguments) |
194 | 194 | { |
195 | - if (! isset($this->rates[$this->date])) { |
|
195 | + if (!isset($this->rates[$this->date])) { |
|
196 | 196 | $this->getRatesFromCBAR(); |
197 | 197 | } |
198 | 198 | |
199 | - if (! isset($this->rates[$this->date][$currency])) { |
|
200 | - throw new CurrencyException('Currency with ' . $currency . ' code is not available'); |
|
199 | + if (!isset($this->rates[$this->date][$currency])) { |
|
200 | + throw new CurrencyException('Currency with '.$currency.' code is not available'); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | return $this->$currency * ($arguments[0] ?? 1); |
@@ -224,12 +224,12 @@ discard block |
||
224 | 224 | */ |
225 | 225 | private function getRatesFromCBAR() |
226 | 226 | { |
227 | - if (! $validatedDate = strtotime($this->date)) { |
|
228 | - throw new DateException($this->date . ' is not a valid date.'); |
|
227 | + if (!$validatedDate = strtotime($this->date)) { |
|
228 | + throw new DateException($this->date.' is not a valid date.'); |
|
229 | 229 | } |
230 | 230 | $this->date = date('d.m.Y', $validatedDate); |
231 | 231 | |
232 | - $response = $this->client->get('https://www.cbar.az/currencies/' . $this->date . '.xml'); |
|
232 | + $response = $this->client->get('https://www.cbar.az/currencies/'.$this->date.'.xml'); |
|
233 | 233 | |
234 | 234 | $xml = simplexml_load_string($response->getBody()->getContents()); |
235 | 235 |