@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | $access_token = json_decode($response->getBody()->getContents())->access_token; |
39 | 39 | |
40 | - if(!empty($access_token)) { |
|
40 | + if (!empty($access_token)) { |
|
41 | 41 | return $access_token; |
42 | 42 | } |
43 | 43 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | function prepareUri($resource) : string |
64 | 64 | { |
65 | - $uri = $this->api_url . '/' . $resource . $this->apiResponseFormat; |
|
65 | + $uri = $this->api_url.'/'.$resource.$this->apiResponseFormat; |
|
66 | 66 | |
67 | 67 | return $uri; |
68 | 68 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | { |
77 | 77 | $response = $this->guzzleClient->get($this->prepareUri('stations'), [ |
78 | 78 | 'headers' => [ |
79 | - 'Authorization' => 'Bearer ' . $this->getAccessToken(), |
|
79 | + 'Authorization' => 'Bearer '.$this->getAccessToken(), |
|
80 | 80 | ] |
81 | 81 | ]); |
82 | 82 | |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | { |
101 | 101 | $response = $this->guzzleClient->get($this->prepareUri('stations/status'), [ |
102 | 102 | 'headers' => [ |
103 | - 'Authorization' => 'Bearer ' . $this->getAccessToken(), |
|
103 | + 'Authorization' => 'Bearer '.$this->getAccessToken(), |
|
104 | 104 | ] |
105 | 105 | ]); |
106 | 106 |
@@ -83,8 +83,7 @@ discard block |
||
83 | 83 | try |
84 | 84 | { |
85 | 85 | $stations = json_decode($response->getBody()->getContents())->stations; |
86 | - } |
|
87 | - catch (\ErrorException $e) { |
|
86 | + } catch (\ErrorException $e) { |
|
88 | 87 | throw new VeloException($e->getMessage(), $e->getCode()); |
89 | 88 | } |
90 | 89 | |
@@ -107,8 +106,7 @@ discard block |
||
107 | 106 | try |
108 | 107 | { |
109 | 108 | $stationsStatuses = json_decode($response->getBody()->getContents())->stationsStatus; |
110 | - } |
|
111 | - catch (\ErrorException $e) { |
|
109 | + } catch (\ErrorException $e) { |
|
112 | 110 | throw new VeloException($e->getMessage(), $e->getCode()); |
113 | 111 | } |
114 | 112 |
@@ -11,11 +11,11 @@ |
||
11 | 11 | $this->veloClient = $veloClient; |
12 | 12 | } |
13 | 13 | |
14 | - public function stations(){ |
|
14 | + public function stations() { |
|
15 | 15 | return $this->veloClient->fetchStations(); |
16 | 16 | } |
17 | 17 | |
18 | - public function stationsStatuses(){ |
|
18 | + public function stationsStatuses() { |
|
19 | 19 | return $this->veloClient->fetchStationsStatuses(); |
20 | 20 | } |
21 | 21 | } |
22 | 22 | \ No newline at end of file |
@@ -13,9 +13,9 @@ |
||
13 | 13 | ], 'config'); |
14 | 14 | } |
15 | 15 | |
16 | - /** |
|
17 | - * Register the service provider. |
|
18 | - */ |
|
16 | + /** |
|
17 | + * Register the service provider. |
|
18 | + */ |
|
19 | 19 | public function register() |
20 | 20 | { |
21 | 21 | $this->mergeConfigFrom(__DIR__.'/../config/laravel-velo-api.php', 'laravel-velo-api'); |
@@ -20,7 +20,7 @@ |
||
20 | 20 | { |
21 | 21 | $this->mergeConfigFrom(__DIR__.'/../config/laravel-velo-api.php', 'laravel-velo-api'); |
22 | 22 | |
23 | - $this->app->bind('velo-api', function () { |
|
23 | + $this->app->bind('velo-api', function() { |
|
24 | 24 | return new Velo(new VeloClient()); |
25 | 25 | }); |
26 | 26 | } |
@@ -5,9 +5,9 @@ |
||
5 | 5 | { |
6 | 6 | $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1); |
7 | 7 | if (php_sapi_name() == 'cli') { |
8 | - print_r("\e[1;30m dumped at: " . str_replace(base_path(), '', $trace[0]['file']). ", line: " . $trace[0]['line'] . "\e[40m\n"); |
|
8 | + print_r("\e[1;30m dumped at: ".str_replace(base_path(), '', $trace[0]['file']).", line: ".$trace[0]['line']."\e[40m\n"); |
|
9 | 9 | } else { |
10 | - print_r("[dumped at: " . str_replace(base_path(), '', $trace[0]['file']). ", line: " . $trace[0]['line'] . "]\n"); |
|
10 | + print_r("[dumped at: ".str_replace(base_path(), '', $trace[0]['file']).", line: ".$trace[0]['line']."]\n"); |
|
11 | 11 | } |
12 | 12 | return dd($var, ...$moreVars); |
13 | 13 | } |