Completed
Pull Request — master (#589)
by
unknown
14:06
created
src/Strategies/Metadata/GetFromMiddleware.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
         $headers = [];
64 64
         if ($authMiddleware) {
65 65
             $guard = preg_replace('/^auth:/', '', $authMiddleware);
66
-            $driver = config('auth.guards.'.$guard.'.driver');
66
+            $driver = config('auth.guards.' . $guard . '.driver');
67 67
             if ($driver === 'token') {
68 68
                 $headers['Authorization'] = 'Token {token}';
69 69
             } else if ($driver === 'passport' || $driver === 'jwt') {
Please login to merge, or discard this patch.
src/Tools/Generator.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         $method = $controller->getMethod($methodName);
55 55
 
56 56
         $parsedRoute = [
57
-            'id' => md5($this->getUri($route).':'.implode($this->getMethods($route))),
57
+            'id' => md5($this->getUri($route) . ':' . implode($this->getMethods($route))),
58 58
             'methods' => $this->getMethods($route),
59 59
             'uri' => $this->getUri($route),
60 60
             'boundUri' => Utils::getFullUrl($route, $rulesToApply['bindings'] ?? ($rulesToApply['response_calls']['bindings'] ?? [])),
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 
72 72
         $responses = $this->fetchResponses($controller, $method, $route, $rulesToApply, $parsedRoute);
73 73
         $parsedRoute['response'] = $responses;
74
-        $parsedRoute['showresponse'] = ! empty($responses);
74
+        $parsedRoute['showresponse'] = !empty($responses);
75 75
 
76 76
         $baseHeaders = $rulesToApply['headers'] ?? [];
77 77
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
     {
114 114
         $responses = $this->iterateThroughStrategies('responses', $context, [$route, $controller, $method, $rulesToApply]);
115 115
         if (count($responses)) {
116
-            return collect($responses)->map(function (string $response, int $status) {
116
+            return collect($responses)->map(function(string $response, int $status) {
117 117
                 return [
118 118
                     'status' => $status ?: 200,
119 119
                     'content' => $response,
@@ -152,14 +152,14 @@  discard block
 block discarded – undo
152 152
             $strategy = new $strategyClass($stage, $this->config);
153 153
             $arguments[] = $context;
154 154
             $results = $strategy(...$arguments);
155
-            if (! is_null($results)) {
155
+            if (!is_null($results)) {
156 156
                 foreach ($results as $index => $item) {
157 157
                     // Using a for loop rather than array_merge or +=
158 158
                     // so it does not renumber numeric keys
159 159
                     // and also allows values to be overwritten
160 160
 
161 161
                     // Don't allow overwriting if an empty value is trying to replace a set one
162
-                    if (! in_array($context[$stage], [null, ''], true) && in_array($item, [null, ''], true)) {
162
+                    if (!in_array($context[$stage], [null, ''], true) && in_array($item, [null, ''], true)) {
163 163
                         continue;
164 164
                     } else {
165 165
                         $context[$stage][$index] = $item;
@@ -184,8 +184,8 @@  discard block
 block discarded – undo
184 184
         $values = [];
185 185
 
186 186
         // Remove params which have no examples.
187
-        $params = array_filter($params, function ($details) {
188
-            return ! is_null($details['value']);
187
+        $params = array_filter($params, function($details) {
188
+            return !is_null($details['value']);
189 189
         });
190 190
 
191 191
         foreach ($params as $paramName => $details) {
Please login to merge, or discard this patch.