@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | protected function getDocBlockResponses(array $tags) |
| 34 | 34 | { |
| 35 | 35 | $responseTags = array_values( |
| 36 | - array_filter($tags, function ($tag) { |
|
| 36 | + array_filter($tags, function($tag) { |
|
| 37 | 37 | return $tag instanceof Tag && strtolower($tag->getName()) === 'response'; |
| 38 | 38 | }) |
| 39 | 39 | ); |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | return null; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - return array_map(function (Tag $responseTag) { |
|
| 45 | + return array_map(function(Tag $responseTag) { |
|
| 46 | 46 | preg_match('/^(\d{3})?\s?([\s\S]*)$/', $responseTag->getContent(), $result); |
| 47 | 47 | |
| 48 | 48 | $status = $result[1] ?: 200; |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | { |
| 35 | 35 | // Avoid "holes" in the keys of the filtered array, by using array_values on the filtered array |
| 36 | 36 | $responseFileTags = array_values( |
| 37 | - array_filter($tags, function ($tag) { |
|
| 37 | + array_filter($tags, function($tag) { |
|
| 38 | 38 | return $tag instanceof Tag && strtolower($tag->getName()) === 'responsefile'; |
| 39 | 39 | }) |
| 40 | 40 | ); |
@@ -43,11 +43,11 @@ discard block |
||
| 43 | 43 | return null; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - return array_map(function (Tag $responseFileTag) { |
|
| 46 | + return array_map(function(Tag $responseFileTag) { |
|
| 47 | 47 | preg_match('/^(\d{3})?\s?([\S]*[\s]*?)(\{.*\})?$/', $responseFileTag->getContent(), $result); |
| 48 | 48 | $status = $result[1] ?: 200; |
| 49 | 49 | $content = $result[2] ? file_get_contents(storage_path(trim($result[2])), true) : '{}'; |
| 50 | - $json = ! empty($result[3]) ? str_replace("'", '"', $result[3]) : '{}'; |
|
| 50 | + $json = !empty($result[3]) ? str_replace("'", '"', $result[3]) : '{}'; |
|
| 51 | 51 | $merged = array_merge(json_decode($content, true), json_decode($json, true)); |
| 52 | 52 | |
| 53 | 53 | return new JsonResponse($merged, (int) $status); |