Completed
Pull Request — master (#416)
by
unknown
01:37
created
src/Tools/ResponseStrategies/ResponseCallStrategy.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
     public function __invoke(Route $route, array $tags, array $routeProps)
23 23
     {
24 24
         $rulesToApply = $routeProps['rules']['response_calls'] ?? [];
25
-        if (! $this->shouldMakeApiCall($route, $rulesToApply)) {
25
+        if (!$this->shouldMakeApiCall($route, $rulesToApply)) {
26 26
             return null;
27 27
         }
28 28
 
@@ -164,14 +164,14 @@  discard block
 block discarded – undo
164 164
         // set URL and query parameters
165 165
         $uri = $request->getRequestUri();
166 166
         $query = $request->getQueryString();
167
-        if (! empty($query)) {
167
+        if (!empty($query)) {
168 168
             $uri .= "?$query";
169 169
         }
170 170
         $response = call_user_func_array([$dispatcher, strtolower($request->method())], [$uri]);
171 171
 
172 172
         // the response from the Dingo dispatcher is the 'raw' response from the controller,
173 173
         // so we have to ensure it's JSON first
174
-        if (! $response instanceof Response) {
174
+        if (!$response instanceof Response) {
175 175
             $response = response()->json($response);
176 176
         }
177 177
 
@@ -315,8 +315,8 @@  discard block
 block discarded – undo
315 315
         $prefix = 'HTTP_';
316 316
         foreach ($headers as $name => $value) {
317 317
             $name = strtr(strtoupper($name), '-', '_');
318
-            if (! starts_with($name, $prefix) && $name !== 'CONTENT_TYPE') {
319
-                $name = $prefix.$name;
318
+            if (!starts_with($name, $prefix) && $name !== 'CONTENT_TYPE') {
319
+                $name = $prefix . $name;
320 320
             }
321 321
             $server[$name] = $value;
322 322
         }
Please login to merge, or discard this patch.
src/Tools/ResponseStrategies/ResponseTagStrategy.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
      */
33 33
     protected function getDocBlockResponses(array $tags)
34 34
     {
35
-        $responseTags = array_filter($tags, function ($tag) {
35
+        $responseTags = array_filter($tags, function($tag) {
36 36
             return $tag instanceof Tag && strtolower($tag->getName()) === 'response';
37 37
         });
38 38
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
             return null;
41 41
         }
42 42
 
43
-        return array_map(function (Tag $responseTag) {
43
+        return array_map(function(Tag $responseTag) {
44 44
             preg_match('/^(\d{3})?\s?([\s\S]*)$/', $responseTag->getContent(), $result);
45 45
 
46 46
             $status = $result[1] ?: 200;
Please login to merge, or discard this patch.
src/Tools/ResponseStrategies/ResponseFileStrategy.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
      */
33 33
     protected function getFileResponses(array $tags)
34 34
     {
35
-        $responseFileTags = array_filter($tags, function ($tag) {
35
+        $responseFileTags = array_filter($tags, function($tag) {
36 36
             return $tag instanceof Tag && strtolower($tag->getName()) === 'responsefile';
37 37
         });
38 38
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
             return null;
41 41
         }
42 42
 
43
-        return array_map(function (Tag $responseFileTag) {
43
+        return array_map(function(Tag $responseFileTag) {
44 44
             preg_match('/^(\d{3})?\s?([\s\S]*)$/', $responseFileTag->getContent(), $result);
45 45
 
46 46
             $status = $result[1] ?: 200;
Please login to merge, or discard this patch.
src/Tools/ResponseResolver.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,8 +48,8 @@
 block discarded – undo
48 48
             /** @var Response[]|null $response */
49 49
             $responses = $strategy($this->route, $tags, $routeProps);
50 50
 
51
-            if (! is_null($responses)) {
52
-                return array_map(function (Response $response) {
51
+            if (!is_null($responses)) {
52
+                return array_map(function(Response $response) {
53 53
                     return ['status' => $response->getStatusCode(), 'content' => $this->getResponseContent($response)];
54 54
                 }, $responses);
55 55
             }
Please login to merge, or discard this patch.