Skip to content

Commit bd075cb

Browse files
committed
Formatting
1 parent b6a67fe commit bd075cb

File tree

6 files changed

+388
-383
lines changed

6 files changed

+388
-383
lines changed

src/Drivers/BaseCurrencyDriver.php

+10-10
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
*/
1717
abstract class BaseCurrencyDriver implements CurrencyDriverContract
1818
{
19-
protected $apiURL = 'localhost';
20-
protected $protocol = 'http';
21-
protected $headers = [
19+
protected $apiURL = 'localhost';
20+
protected $protocol = 'http';
21+
protected $headers = [
2222
'Accept' => 'application/json',
2323
'Content-Type' => 'application/json',
2424
];
@@ -28,8 +28,8 @@ abstract class BaseCurrencyDriver implements CurrencyDriverContract
2828
protected $amount = 0.00;
2929
protected $date = null;
3030

31-
protected $httpClient = null;
32-
protected $httpParams = [];
31+
protected $httpClient = null;
32+
protected $httpParams = [];
3333

3434
/**
3535
* BaseDriver constructor.
@@ -58,7 +58,7 @@ public function source(string $baseCurrency): CurrencyDriverContract
5858
* @param string $baseCurrency
5959
*
6060
* @return CurrencyDriverContract
61-
*@see CurrencyDriverContract::source()
61+
* @see CurrencyDriverContract::source()
6262
*
6363
*/
6464
public function from(string $baseCurrency): CurrencyDriverContract
@@ -83,7 +83,7 @@ public function currencies($symbols = []): CurrencyDriverContract
8383
* @param array $symbols
8484
*
8585
* @return CurrencyDriverContract
86-
*@see CurrencyDriverContract::currencies()
86+
* @see CurrencyDriverContract::currencies()
8787
*
8888
*/
8989
public function to($symbols = []): CurrencyDriverContract
@@ -111,7 +111,7 @@ public function amount($amount): CurrencyDriverContract
111111
*/
112112
public function date($date): CurrencyDriverContract
113113
{
114-
if($date === null) {
114+
if ($date === null) {
115115
return $this;
116116
}
117117

@@ -210,14 +210,14 @@ function apiRequest(string $endpoint, array $params = [], string $method = 'GET'
210210

211211
try {
212212
$response = $this->httpClient->request($method, $url, ['query' => array_merge($this->httpParams, $params)])->getBody();
213-
} catch (GuzzleException $e ) {
213+
} catch (GuzzleException $e) {
214214
throw new ApiException($e->getMessage(), $e->getCode(), $e);
215215
}
216216

217217
$data = json_decode($response->getContents(), true);
218218

219219
// Check for JSON errors
220-
if(json_last_error() !== JSON_ERROR_NONE || ! is_array($data)) {
220+
if (json_last_error() !== JSON_ERROR_NONE || !is_array($data)) {
221221
throw new ApiException(json_last_error_msg(), json_last_error());
222222
}
223223

src/Drivers/CurrencyDriverContract.php

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ interface CurrencyDriverContract
1616
* @return self
1717
*/
1818
public function source(string $baseCurrency): CurrencyDriverContract;
19+
1920
public function from(string $baseCurrency): CurrencyDriverContract; // Alias
2021

2122
/**
@@ -24,6 +25,7 @@ public function from(string $baseCurrency): CurrencyDriverContract; // Alias
2425
* @return self
2526
*/
2627
public function currencies($symbols = []): CurrencyDriverContract;
28+
2729
public function to($symbols = []): CurrencyDriverContract; // Alias
2830

2931
/**

0 commit comments

Comments
 (0)