Completed
Push — master ( 0eb4d6...a581bc )
by Michal
10:57
created
src/Handlers/OpenApiHandler.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
         $data = [
153 153
             'openapi' => '3.0.0',
154 154
             'info' => [
155
-                'version' => (string)$version,
155
+                'version' => (string) $version,
156 156
                 'title' => 'Nette API',
157 157
             ],
158 158
             'servers' => [
@@ -211,11 +211,11 @@  discard block
 block discarded – undo
211 211
             'paths' => $this->getPaths($apis, $baseUrl, $basePath),
212 212
         ];
213 213
 
214
-        if (!$securitySchemes) {
214
+        if ( ! $securitySchemes) {
215 215
             unset($data['components']['securitySchemes']);
216 216
         }
217 217
 
218
-        if (!empty($this->definitions)) {
218
+        if ( ! empty($this->definitions)) {
219 219
             $data['components']['schemas'] = array_merge($this->definitions, $data['components']['schemas']);
220 220
         }
221 221
 
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 
230 230
     private function getApis(int $version): array
231 231
     {
232
-        return array_filter($this->apiDecider->getApis(), function (Api $api) use ($version) {
232
+        return array_filter($this->apiDecider->getApis(), function(Api $api) use ($version) {
233 233
             return $version === $api->getEndpoint()->getVersion();
234 234
         });
235 235
     }
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
             $parameters = $this->createParamsList($handler);
263 263
             $requestBody = $this->createRequestBody($handler);
264 264
 
265
-            if (!empty($parameters) || !empty($requestBody)) {
265
+            if ( ! empty($parameters) || ! empty($requestBody)) {
266 266
                 $responses[IResponse::S400_BAD_REQUEST] = [
267 267
                     'description' => 'Bad request',
268 268
                     'content' => [
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 
278 278
             $authorization = $api->getAuthorization();
279 279
 
280
-            if (!$authorization instanceof NoAuthorization) {
280
+            if ( ! $authorization instanceof NoAuthorization) {
281 281
                 $responses[IResponse::S403_FORBIDDEN] = [
282 282
                     'description' => 'Operation forbidden',
283 283
                     'content' => [
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
             foreach ($handler->outputs() as $output) {
305 305
                 if ($output instanceof JsonOutput) {
306 306
                     $schema = $this->transformSchema(json_decode($output->getSchema(), true));
307
-                    if (!isset($responses[$output->getCode()])) {
307
+                    if ( ! isset($responses[$output->getCode()])) {
308 308
                         $responses[$output->getCode()] = [
309 309
                             'description' => $output->getDescription(),
310 310
                             'content' => [
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
                             ]
315 315
                         ];
316 316
                     } else {
317
-                        if (!isset($responses[$output->getCode()]['content']['application/json; charset=utf-8']['schema']['oneOf'])) {
317
+                        if ( ! isset($responses[$output->getCode()]['content']['application/json; charset=utf-8']['schema']['oneOf'])) {
318 318
                             $tmp = $responses[$output->getCode()]['content']['application/json; charset=utf-8']['schema'];
319 319
                             unset($responses[$output->getCode()]['content']['application/json; charset=utf-8']['schema']);
320 320
                             $responses[$output->getCode()]['content']['application/json; charset=utf-8']['schema'] = [
@@ -341,11 +341,11 @@  discard block
 block discarded – undo
341 341
                 }
342 342
             }
343 343
 
344
-            if (!empty($parameters)) {
344
+            if ( ! empty($parameters)) {
345 345
                 $settings['parameters'] = $parameters;
346 346
             }
347 347
 
348
-            if (!empty($requestBody)) {
348
+            if ( ! empty($requestBody)) {
349 349
                 $settings['requestBody'] = $requestBody;
350 350
             }
351 351
 
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
             }
559 559
         }
560 560
 
561
-        if (!empty($requestBody['properties'])) {
561
+        if ( ! empty($requestBody['properties'])) {
562 562
             $requestBodySchema = [
563 563
                 'type' => 'object',
564 564
                 'properties' => $requestBody['properties'],
Please login to merge, or discard this patch.