@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | public function __invoke(Route $route, \ReflectionClass $controller, \ReflectionMethod $method, array $routeRules, array $context = []) |
| 32 | 32 | { |
| 33 | 33 | $rulesToApply = $routeRules['response_calls'] ?? []; |
| 34 | - if (! $this->shouldMakeApiCall($route, $rulesToApply, $context)) { |
|
| 34 | + if (!$this->shouldMakeApiCall($route, $rulesToApply, $context)) { |
|
| 35 | 35 | return null; |
| 36 | 36 | } |
| 37 | 37 | |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | $response = $this->makeApiCall($request); |
| 47 | 47 | $response = [$response->getStatusCode() => $response->getContent()]; |
| 48 | 48 | } catch (\Exception $e) { |
| 49 | - echo 'Exception thrown during response call for ['.implode(',', $route->methods)."] {$route->uri}.\n"; |
|
| 49 | + echo 'Exception thrown during response call for [' . implode(',', $route->methods) . "] {$route->uri}.\n"; |
|
| 50 | 50 | if (Flags::$shouldBeVerbose) { |
| 51 | 51 | Utils::dumpException($e); |
| 52 | 52 | } else { |
@@ -179,14 +179,14 @@ discard block |
||
| 179 | 179 | // set URL and query parameters |
| 180 | 180 | $uri = $request->getRequestUri(); |
| 181 | 181 | $query = $request->getQueryString(); |
| 182 | - if (! empty($query)) { |
|
| 182 | + if (!empty($query)) { |
|
| 183 | 183 | $uri .= "?$query"; |
| 184 | 184 | } |
| 185 | 185 | $response = call_user_func_array([$dispatcher, strtolower($request->method())], [$uri]); |
| 186 | 186 | |
| 187 | 187 | // the response from the Dingo dispatcher is the 'raw' response from the controller, |
| 188 | 188 | // so we have to ensure it's JSON first |
| 189 | - if (! $response instanceof Response) { |
|
| 189 | + if (!$response instanceof Response) { |
|
| 190 | 190 | $response = response()->json($response); |
| 191 | 191 | } |
| 192 | 192 | |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | protected function callLaravelRoute(Request $request): \Symfony\Component\HttpFoundation\Response |
| 288 | 288 | { |
| 289 | 289 | // Confirm we're running in Laravel, not Lumen |
| 290 | - if(app()->bound(\Illuminate\Contracts\Http\Kernel::class)){ |
|
| 290 | + if (app()->bound(\Illuminate\Contracts\Http\Kernel::class)) { |
|
| 291 | 291 | $kernel = app(\Illuminate\Contracts\Http\Kernel::class); |
| 292 | 292 | $response = $kernel->handle($request); |
| 293 | 293 | $kernel->terminate($request, $response); |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | return false; |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | - if (! empty($context['responses'])) { |
|
| 316 | + if (!empty($context['responses'])) { |
|
| 317 | 317 | // Don't attempt a response call if there are already responses |
| 318 | 318 | return false; |
| 319 | 319 | } |
@@ -347,8 +347,8 @@ discard block |
||
| 347 | 347 | $prefix = 'HTTP_'; |
| 348 | 348 | foreach ($headers as $name => $value) { |
| 349 | 349 | $name = strtr(strtoupper($name), '-', '_'); |
| 350 | - if (! Str::startsWith($name, $prefix) && $name !== 'CONTENT_TYPE') { |
|
| 351 | - $name = $prefix.$name; |
|
| 350 | + if (!Str::startsWith($name, $prefix) && $name !== 'CONTENT_TYPE') { |
|
| 351 | + $name = $prefix . $name; |
|
| 352 | 352 | } |
| 353 | 353 | $server[$name] = $value; |
| 354 | 354 | } |