@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | public function __invoke(Route $route, \ReflectionClass $controller, \ReflectionMethod $method, array $routeRules, array $context = []) |
32 | 32 | { |
33 | 33 | $rulesToApply = $routeRules['response_calls'] ?? []; |
34 | - if (! $this->shouldMakeApiCall($route, $rulesToApply, $context)) { |
|
34 | + if (!$this->shouldMakeApiCall($route, $rulesToApply, $context)) { |
|
35 | 35 | return null; |
36 | 36 | } |
37 | 37 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | ], |
53 | 53 | ]; |
54 | 54 | } catch (\Exception $e) { |
55 | - echo 'Exception thrown during response call for ['.implode(',', $route->methods)."] {$route->uri}.\n"; |
|
55 | + echo 'Exception thrown during response call for [' . implode(',', $route->methods) . "] {$route->uri}.\n"; |
|
56 | 56 | if (Flags::$shouldBeVerbose) { |
57 | 57 | Utils::dumpException($e); |
58 | 58 | } else { |
@@ -186,14 +186,14 @@ discard block |
||
186 | 186 | // set URL and query parameters |
187 | 187 | $uri = $request->getRequestUri(); |
188 | 188 | $query = $request->getQueryString(); |
189 | - if (! empty($query)) { |
|
189 | + if (!empty($query)) { |
|
190 | 190 | $uri .= "?$query"; |
191 | 191 | } |
192 | 192 | $response = call_user_func_array([$dispatcher, strtolower($request->method())], [$uri]); |
193 | 193 | |
194 | 194 | // the response from the Dingo dispatcher is the 'raw' response from the controller, |
195 | 195 | // so we have to ensure it's JSON first |
196 | - if (! $response instanceof Response) { |
|
196 | + if (!$response instanceof Response) { |
|
197 | 197 | $response = response()->json($response); |
198 | 198 | } |
199 | 199 | |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | } |
322 | 322 | |
323 | 323 | // Don't attempt a response call if there are already successful responses |
324 | - $successResponses = collect($context['responses'])->filter(function ($response) { |
|
324 | + $successResponses = collect($context['responses'])->filter(function($response) { |
|
325 | 325 | return ((string) $response['status'])[0] == '2'; |
326 | 326 | })->count(); |
327 | 327 | if ($successResponses) { |
@@ -357,8 +357,8 @@ discard block |
||
357 | 357 | $prefix = 'HTTP_'; |
358 | 358 | foreach ($headers as $name => $value) { |
359 | 359 | $name = strtr(strtoupper($name), '-', '_'); |
360 | - if (! Str::startsWith($name, $prefix) && $name !== 'CONTENT_TYPE') { |
|
361 | - $name = $prefix.$name; |
|
360 | + if (!Str::startsWith($name, $prefix) && $name !== 'CONTENT_TYPE') { |
|
361 | + $name = $prefix . $name; |
|
362 | 362 | } |
363 | 363 | $server[$name] = $value; |
364 | 364 | } |
@@ -9,7 +9,7 @@ |
||
9 | 9 | { |
10 | 10 | public static function routes($path = '/doc') |
11 | 11 | { |
12 | - return Route::get("$path{format?}", function (?string $format = null) { |
|
12 | + return Route::get("$path{format?}", function(?string $format = null) { |
|
13 | 13 | if ($format == '.json') { |
14 | 14 | return response( |
15 | 15 | Storage::disk('local')->get('apidoc/collection.json'), |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | public static function replaceUrlParameterPlaceholdersWithValues(string $uri, array $urlParameters) |
54 | 54 | { |
55 | 55 | $matches = preg_match_all('/{.+?}/i', $uri, $parameterPaths); |
56 | - if (! $matches) { |
|
56 | + if (!$matches) { |
|
57 | 57 | return $uri; |
58 | 58 | } |
59 | 59 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | |
89 | 89 | public static function deleteDirectoryAndContents($dir) |
90 | 90 | { |
91 | - $adapter = new Local(realpath(__DIR__.'/../../')); |
|
91 | + $adapter = new Local(realpath(__DIR__ . '/../../')); |
|
92 | 92 | $fs = new Filesystem($adapter); |
93 | 93 | $fs->deleteDir($dir); |
94 | 94 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | $result = ''; |
102 | 102 | $padWith = str_repeat(' ', $indentationLevel); |
103 | 103 | foreach ($split as $index => $line) { |
104 | - $result .= ($index == 0 ? '' : "\n$padWith").$line; |
|
104 | + $result .= ($index == 0 ? '' : "\n$padWith") . $line; |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | return $result; |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | $groupedRoutes = collect($parsedRoutes) |
75 | 75 | ->groupBy('metadata.groupName') |
76 | - ->sortBy(static function ($group) { |
|
76 | + ->sortBy(static function($group) { |
|
77 | 77 | /* @var $group Collection */ |
78 | 78 | return $group->first()['metadata']['groupName']; |
79 | 79 | }, SORT_NATURAL); |
@@ -100,9 +100,9 @@ discard block |
||
100 | 100 | /** @var Route $route */ |
101 | 101 | if ($this->isValidRoute($route) && $this->isRouteVisibleForDocumentation($route->getAction())) { |
102 | 102 | $parsedRoutes[] = $generator->processRoute($route, $routeItem['apply'] ?? []); |
103 | - $this->info('Processed route: ['.implode(',', $generator->getMethods($route)).'] '.$generator->getUri($route)); |
|
103 | + $this->info('Processed route: [' . implode(',', $generator->getMethods($route)) . '] ' . $generator->getUri($route)); |
|
104 | 104 | } else { |
105 | - $this->warn('Skipping route: ['.implode(',', $generator->getMethods($route)).'] '.$generator->getUri($route)); |
|
105 | + $this->warn('Skipping route: [' . implode(',', $generator->getMethods($route)) . '] ' . $generator->getUri($route)); |
|
106 | 106 | } |
107 | 107 | } |
108 | 108 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | $action = implode('@', $action); |
122 | 122 | } |
123 | 123 | |
124 | - return ! is_callable($action) && ! is_null($action); |
|
124 | + return !is_callable($action) && !is_null($action); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | /** |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | list($class, $method) = Utils::getRouteClassAndMethodNames($action); |
137 | 137 | $reflection = new ReflectionClass($class); |
138 | 138 | |
139 | - if (! $reflection->hasMethod($method)) { |
|
139 | + if (!$reflection->hasMethod($method)) { |
|
140 | 140 | return false; |
141 | 141 | } |
142 | 142 | |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | $phpdoc = new DocBlock($comment); |
147 | 147 | |
148 | 148 | return collect($phpdoc->getTags()) |
149 | - ->filter(function ($tag) { |
|
149 | + ->filter(function($tag) { |
|
150 | 150 | return $tag->getName() === 'hideFromAPIDocumentation'; |
151 | 151 | }) |
152 | 152 | ->isEmpty(); |