16
16
*/
17
17
abstract class BaseCurrencyDriver implements CurrencyDriverContract
18
18
{
19
- protected $ apiURL = 'localhost ' ;
20
- protected $ protocol = 'http ' ;
21
- protected $ headers = [
19
+ protected $ apiURL = 'localhost ' ;
20
+ protected $ protocol = 'http ' ;
21
+ protected $ headers = [
22
22
'Accept ' => 'application/json ' ,
23
23
'Content-Type ' => 'application/json ' ,
24
24
];
@@ -28,8 +28,8 @@ abstract class BaseCurrencyDriver implements CurrencyDriverContract
28
28
protected $ amount = 0.00 ;
29
29
protected $ date = null ;
30
30
31
- protected $ httpClient = null ;
32
- protected $ httpParams = [];
31
+ protected $ httpClient = null ;
32
+ protected $ httpParams = [];
33
33
34
34
/**
35
35
* BaseDriver constructor.
@@ -58,7 +58,7 @@ public function source(string $baseCurrency): CurrencyDriverContract
58
58
* @param string $baseCurrency
59
59
*
60
60
* @return CurrencyDriverContract
61
- *@see CurrencyDriverContract::source()
61
+ * @see CurrencyDriverContract::source()
62
62
*
63
63
*/
64
64
public function from (string $ baseCurrency ): CurrencyDriverContract
@@ -83,7 +83,7 @@ public function currencies($symbols = []): CurrencyDriverContract
83
83
* @param array $symbols
84
84
*
85
85
* @return CurrencyDriverContract
86
- *@see CurrencyDriverContract::currencies()
86
+ * @see CurrencyDriverContract::currencies()
87
87
*
88
88
*/
89
89
public function to ($ symbols = []): CurrencyDriverContract
@@ -111,7 +111,7 @@ public function amount($amount): CurrencyDriverContract
111
111
*/
112
112
public function date ($ date ): CurrencyDriverContract
113
113
{
114
- if ($ date === null ) {
114
+ if ($ date === null ) {
115
115
return $ this ;
116
116
}
117
117
@@ -210,14 +210,14 @@ function apiRequest(string $endpoint, array $params = [], string $method = 'GET'
210
210
211
211
try {
212
212
$ response = $ this ->httpClient ->request ($ method , $ url , ['query ' => array_merge ($ this ->httpParams , $ params )])->getBody ();
213
- } catch (GuzzleException $ e ) {
213
+ } catch (GuzzleException $ e ) {
214
214
throw new ApiException ($ e ->getMessage (), $ e ->getCode (), $ e );
215
215
}
216
216
217
217
$ data = json_decode ($ response ->getContents (), true );
218
218
219
219
// 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 )) {
221
221
throw new ApiException (json_last_error_msg (), json_last_error ());
222
222
}
223
223
0 commit comments