@@ -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 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | $access_token = json_decode($response->getBody()->getContents())->access_token; |
| 46 | 46 | |
| 47 | - if(!empty($access_token)) { |
|
| 47 | + if (!empty($access_token)) { |
|
| 48 | 48 | return $access_token; |
| 49 | 49 | } |
| 50 | 50 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | private function prepareUri($resource) : string |
| 71 | 71 | { |
| 72 | - $uri = $this->api_url . '/' . $resource . $this->apiResponseFormat; |
|
| 72 | + $uri = $this->api_url.'/'.$resource.$this->apiResponseFormat; |
|
| 73 | 73 | |
| 74 | 74 | return $uri; |
| 75 | 75 | } |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | { |
| 84 | 84 | $response = $this->guzzleClient->get($this->prepareUri('stations'), [ |
| 85 | 85 | 'headers' => [ |
| 86 | - 'Authorization' => 'Bearer ' . $this->getAccessToken(), |
|
| 86 | + 'Authorization' => 'Bearer '.$this->getAccessToken(), |
|
| 87 | 87 | ] |
| 88 | 88 | ]); |
| 89 | 89 | |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | { |
| 108 | 108 | $response = $this->guzzleClient->get($this->prepareUri('stations/status'), [ |
| 109 | 109 | 'headers' => [ |
| 110 | - 'Authorization' => 'Bearer ' . $this->getAccessToken(), |
|
| 110 | + 'Authorization' => 'Bearer '.$this->getAccessToken(), |
|
| 111 | 111 | ] |
| 112 | 112 | ]); |
| 113 | 113 | |
@@ -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 | } |