Completed
Pull Request — master (#457)
by
unknown
01:39
created
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 [
54 54
                         'headers' => $response->headers,
55 55
                         'statusText' => Response::$statusTexts[$response->getStatusCode()],
Please login to merge, or discard this patch.
src/Postman/CollectionWriter.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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,18 +137,18 @@  discard block
 block discarded – undo
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) = array_pad(explode("\n\n", $group), 2, null);
147 147
 
148 148
                 return [
149 149
                     'name' => $groupName,
150 150
                     'description' => $groupDescription,
151
-                    'item' => $routes->map(function ($route) {
151
+                    'item' => $routes->map(function($route) {
152 152
                         $mode = $route['methods'][0] === 'PUT' ? 'urlencoded' : 'formdata';
153 153
 
154 154
                         return [
@@ -160,8 +160,8 @@  discard block
 block discarded – undo
160 160
                                     'exec' => [
161 161
                                         'var response = JSON.parse(responseBody);',
162 162
                                         'tests["Successful request"] = responseCode.code === 200;',
163
-                                        'if (response.'.$this->getResponseAccessTokenKey().') { postman.setEnvironmentVariable("'.$this->getAccessTokenVariable().'", response.'.$this->getResponseAccessTokenKey().'); }',
164
-                                        'if (response.'.$this->getResponseRefreshTokenKey().') { postman.setEnvironmentVariable("'.$this->getRefreshTokenVariable().'", response.'.$this->getResponseRefreshTokenKey().'); }',
163
+                                        'if (response.' . $this->getResponseAccessTokenKey() . ') { postman.setEnvironmentVariable("' . $this->getAccessTokenVariable() . '", response.' . $this->getResponseAccessTokenKey() . '); }',
164
+                                        'if (response.' . $this->getResponseRefreshTokenKey() . ') { postman.setEnvironmentVariable("' . $this->getRefreshTokenVariable() . '", response.' . $this->getResponseRefreshTokenKey() . '); }',
165 165
                                     ],
166 166
                                     'type' => 'text/javascript',
167 167
                                 ] : [],
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
                                     'status' => $route['response'][0]['statusText'],
175 175
                                     'code' => $route['response'][0]['status'],
176 176
                                     '_postman_previewlanguage' => 'json',
177
-                                    'header' => collect($route['response'][0]['headers'])->map(function ($header, $key) use ($route) {
177
+                                    'header' => collect($route['response'][0]['headers'])->map(function($header, $key) use ($route) {
178 178
                                         return [
179 179
                                             'key' => $key,
180 180
                                             'name' => $key,
Please login to merge, or discard this patch.