@@ -48,8 +48,8 @@ |
||
| 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 [ |
| 54 | 54 | 'headers' => $response->headers, |
| 55 | 55 | 'statusText' => Response::$statusTexts[$response->getStatusCode()], |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | if ($this->usePostmanEnvironment) { |
| 45 | 45 | $baseUrl = config('apidoc.postman.environment.variables.baseUrl'); |
| 46 | 46 | if ($baseUrl) { |
| 47 | - return '{{'.$baseUrl.'}}'.'/'.$route['uri']; |
|
| 47 | + return '{{' . $baseUrl . '}}' . '/' . $route['uri']; |
|
| 48 | 48 | } else { |
| 49 | 49 | return url($route['uri']); |
| 50 | 50 | } |
@@ -97,12 +97,12 @@ discard block |
||
| 97 | 97 | 'auth' => $route['authenticated'] ? [ |
| 98 | 98 | 'type' => 'bearer', |
| 99 | 99 | 'bearer' => [ |
| 100 | - 'token' => '{{'.$this->getAccessTokenVariable().'}}', |
|
| 100 | + 'token' => '{{' . $this->getAccessTokenVariable() . '}}', |
|
| 101 | 101 | ], |
| 102 | 102 | ] : false, |
| 103 | 103 | 'url' => $this->getRouteUri($route), |
| 104 | 104 | 'method' => $route['methods'][0], |
| 105 | - 'header' => collect($route['headers'])->map(function ($header, $key) use ($route) { |
|
| 105 | + 'header' => collect($route['headers'])->map(function($header, $key) use ($route) { |
|
| 106 | 106 | if (in_array($key, $this->getExcludingHeaders())) { |
| 107 | 107 | return; |
| 108 | 108 | } |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | })->filter()->values()->toArray(), |
| 117 | 117 | 'body' => [ |
| 118 | 118 | 'mode' => $mode, |
| 119 | - $mode => collect($route['bodyParameters'])->map(function ($parameter, $key) { |
|
| 119 | + $mode => collect($route['bodyParameters'])->map(function($parameter, $key) { |
|
| 120 | 120 | return [ |
| 121 | 121 | 'key' => $key, |
| 122 | 122 | 'value' => isset($parameter['value']) ? ($parameter['type'] === 'boolean' ? (string) $parameter['value'] : $parameter['value']) : '', |
@@ -137,17 +137,17 @@ discard block |
||
| 137 | 137 | $collection = [ |
| 138 | 138 | 'variables' => [], |
| 139 | 139 | 'info' => [ |
| 140 | - 'name' => config('apidoc.postman.name') ?: config('app.name').' API', |
|
| 140 | + 'name' => config('apidoc.postman.name') ?: config('app.name') . ' API', |
|
| 141 | 141 | '_postman_id' => Uuid::uuid4()->toString(), |
| 142 | 142 | 'description' => config('apidoc.postman.description') ?: '', |
| 143 | 143 | 'schema' => 'https://schema.getpostman.com/json/collection/v2.0.0/collection.json', |
| 144 | 144 | ], |
| 145 | - 'item' => $this->routeGroups->map(function ($routes, $group) { |
|
| 145 | + 'item' => $this->routeGroups->map(function($routes, $group) { |
|
| 146 | 146 | list($groupName, $groupDescription) = explode("\n\n", $group); |
| 147 | 147 | return [ |
| 148 | 148 | 'name' => $groupName, |
| 149 | 149 | 'description' => $groupDescription, |
| 150 | - 'item' => $routes->map(function ($route) { |
|
| 150 | + 'item' => $routes->map(function($route) { |
|
| 151 | 151 | $mode = $route['methods'][0] === 'PUT' ? 'urlencoded' : 'formdata'; |
| 152 | 152 | |
| 153 | 153 | return [ |
@@ -159,8 +159,8 @@ discard block |
||
| 159 | 159 | 'exec' => [ |
| 160 | 160 | 'var response = JSON.parse(responseBody);', |
| 161 | 161 | 'tests["Successful request"] = responseCode.code === 200;', |
| 162 | - 'if (response.'.$this->getResponseAccessTokenKey().') { postman.setEnvironmentVariable("'.$this->getAccessTokenVariable().'", response.'.$this->getResponseAccessTokenKey().'); }', |
|
| 163 | - 'if (response.'.$this->getResponseRefreshTokenKey().') { postman.setEnvironmentVariable("'.$this->getRefreshTokenVariable().'", response.'.$this->getResponseRefreshTokenKey().'); }', |
|
| 162 | + 'if (response.' . $this->getResponseAccessTokenKey() . ') { postman.setEnvironmentVariable("' . $this->getAccessTokenVariable() . '", response.' . $this->getResponseAccessTokenKey() . '); }', |
|
| 163 | + 'if (response.' . $this->getResponseRefreshTokenKey() . ') { postman.setEnvironmentVariable("' . $this->getRefreshTokenVariable() . '", response.' . $this->getResponseRefreshTokenKey() . '); }', |
|
| 164 | 164 | ], |
| 165 | 165 | 'type' => 'text/javascript', |
| 166 | 166 | ] : [], |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | 'status' => $route['response'][0]['statusText'], |
| 174 | 174 | 'code' => $route['response'][0]['status'], |
| 175 | 175 | '_postman_previewlanguage' => 'json', |
| 176 | - 'header' => collect($route['response'][0]['headers'])->map(function ($header, $key) use ($route) { |
|
| 176 | + 'header' => collect($route['response'][0]['headers'])->map(function($header, $key) use ($route) { |
|
| 177 | 177 | return [ |
| 178 | 178 | 'key' => $key, |
| 179 | 179 | 'name' => $key, |