Completed
Pull Request — master (#581)
by
unknown
01:07
created
src/Strategies/Responses/ResponseCalls.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
             return false;
307 307
         }
308 308
 
309
-        if (! empty($context['responses'])) {
309
+        if (!empty($context['responses'])) {
310 310
             // Don't attempt a response call if there are already responses
311 311
             return false;
312 312
         }
@@ -340,8 +340,8 @@  discard block
 block discarded – undo
340 340
         $prefix = 'HTTP_';
341 341
         foreach ($headers as $name => $value) {
342 342
             $name = strtr(strtoupper($name), '-', '_');
343
-            if (! Str::startsWith($name, $prefix) && $name !== 'CONTENT_TYPE') {
344
-                $name = $prefix.$name;
343
+            if (!Str::startsWith($name, $prefix) && $name !== 'CONTENT_TYPE') {
344
+                $name = $prefix . $name;
345 345
             }
346 346
             $server[$name] = $value;
347 347
         }
Please login to merge, or discard this patch.