@@ -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()], |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | ] : false, |
102 | 102 | 'url' => $this->getRouteUri($route), |
103 | 103 | 'method' => $route['methods'][0], |
104 | - 'header' => collect($route['headers'])->map(function ($header, $key) use ($route) { |
|
104 | + 'header' => collect($route['headers'])->map(function($header, $key) use ($route) { |
|
105 | 105 | if (in_array($key, $this->getExcludingHeaders())) { |
106 | 106 | return; |
107 | 107 | } |
@@ -115,10 +115,10 @@ discard block |
||
115 | 115 | })->filter()->values()->toArray(), |
116 | 116 | 'body' => [ |
117 | 117 | 'mode' => $mode, |
118 | - $mode => collect($route['bodyParameters'])->map(function ($parameter, $key) { |
|
118 | + $mode => collect($route['bodyParameters'])->map(function($parameter, $key) { |
|
119 | 119 | return [ |
120 | 120 | 'key' => $key, |
121 | - 'value' => isset($parameter['value']) ? ($parameter['type'] === 'boolean' ? (string)$parameter['value'] : $parameter['value']) : '', |
|
121 | + 'value' => isset($parameter['value']) ? ($parameter['type'] === 'boolean' ? (string) $parameter['value'] : $parameter['value']) : '', |
|
122 | 122 | 'description' => implode(' | ', [($parameter['required'] ? 'required' : 'optional'), $parameter['type'], $parameter['description']]), |
123 | 123 | 'type' => 'text', |
124 | 124 | 'enabled' => true, |
@@ -136,17 +136,17 @@ discard block |
||
136 | 136 | $collection = [ |
137 | 137 | 'variables' => [], |
138 | 138 | 'info' => [ |
139 | - 'name' => config('apidoc.postman.name') ?: config('app.name').' API', |
|
139 | + 'name' => config('apidoc.postman.name') ?: config('app.name') . ' API', |
|
140 | 140 | '_postman_id' => Uuid::uuid4()->toString(), |
141 | 141 | 'description' => config('apidoc.postman.description') ?: '', |
142 | 142 | 'schema' => 'https://schema.getpostman.com/json/collection/v2.0.0/collection.json', |
143 | 143 | ], |
144 | - 'item' => $this->routeGroups->map(function ($routes, $group) { |
|
144 | + 'item' => $this->routeGroups->map(function($routes, $group) { |
|
145 | 145 | list($groupName, $groupDescription) = explode("\n\n", $group); |
146 | 146 | return [ |
147 | 147 | 'name' => $groupName, |
148 | 148 | 'description' => $groupDescription, |
149 | - 'item' => $routes->map(function ($route) { |
|
149 | + 'item' => $routes->map(function($route) { |
|
150 | 150 | $mode = $route['methods'][0] === 'PUT' ? 'urlencoded' : 'formdata'; |
151 | 151 | |
152 | 152 | return [ |
@@ -158,8 +158,8 @@ discard block |
||
158 | 158 | 'exec' => [ |
159 | 159 | 'var response = JSON.parse(responseBody);', |
160 | 160 | 'tests["Successfull POST request"] = responseCode.code === 200;', |
161 | - 'if (response.' . $this->getResponseAccessTokenKey() . ') { postman.setEnvironmentVariable("'. $this->getAccessTokenVariable() .'", response.' . $this->getResponseAccessTokenKey() . '); }', |
|
162 | - 'if (response.' . $this->getResponseRefreshTokenKey() . ') { postman.setEnvironmentVariable("'. $this->getRefreshTokenVariable() .'", response.' . $this->getResponseRefreshTokenKey() . '); }', |
|
161 | + 'if (response.' . $this->getResponseAccessTokenKey() . ') { postman.setEnvironmentVariable("' . $this->getAccessTokenVariable() . '", response.' . $this->getResponseAccessTokenKey() . '); }', |
|
162 | + 'if (response.' . $this->getResponseRefreshTokenKey() . ') { postman.setEnvironmentVariable("' . $this->getRefreshTokenVariable() . '", response.' . $this->getResponseRefreshTokenKey() . '); }', |
|
163 | 163 | ], |
164 | 164 | 'type' => 'text/javascript', |
165 | 165 | ] : [], |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | 'status' => $route['response'][0]['statusText'], |
173 | 173 | 'code' => $route['response'][0]['status'], |
174 | 174 | '_postman_previewlanguage' => 'json', |
175 | - 'header' => collect($route['response'][0]['headers'])->map(function ($header, $key) use ($route) { |
|
175 | + 'header' => collect($route['response'][0]['headers'])->map(function($header, $key) use ($route) { |
|
176 | 176 | return [ |
177 | 177 | 'key' => $key, |
178 | 178 | 'name' => $key, |