Skip to content

Commit 552074f

Browse files
authored
Merge pull request #64 from mpociot/analysis-8ma7Q7
Applied fixes from StyleCI
2 parents 047e0d1 + 28143ca commit 552074f

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

src/Mpociot/ApiDoc/Commands/GenerateDocumentation.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ private function writeMarkdown($parsedRoutes)
9393

9494
$markdown = view('apidoc::documentarian')
9595
->with('outputPath', $this->option('output'))
96-
->with('showPostmanCollectionButton', !$this->option('noPostmanCollection'))
96+
->with('showPostmanCollectionButton', ! $this->option('noPostmanCollection'))
9797
->with('parsedRoutes', $parsedRoutes->all());
9898

9999
if (! is_dir($outputPath)) {
@@ -228,14 +228,16 @@ private function isValidRoute($route)
228228
}
229229

230230
/**
231-
* Generate Postman collection JSON file
231+
* Generate Postman collection JSON file.
232232
*
233233
* @param Collection $routes
234+
*
234235
* @return string
235236
*/
236237
private function generatePostmanCollection(Collection $routes)
237238
{
238239
$writer = new CollectionWriter($routes);
240+
239241
return $writer->getCollection();
240242
}
241243
}

src/Mpociot/ApiDoc/Postman/CollectionWriter.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class CollectionWriter
1414

1515
/**
1616
* CollectionWriter constructor.
17+
*
1718
* @param Collection $routeGroups
1819
*/
1920
public function __construct(Collection $routeGroups)
@@ -29,7 +30,7 @@ public function getCollection()
2930
'name' => '',
3031
'_postman_id' => Uuid::uuid1()->toString(),
3132
'description' => '',
32-
'schema' => 'https://schema.getpostman.com/json/collection/v2.0.0/collection.json'
33+
'schema' => 'https://schema.getpostman.com/json/collection/v2.0.0/collection.json',
3334
],
3435
'item' => $this->routeGroups->map(function ($routes, $groupName) {
3536
return [
@@ -48,20 +49,19 @@ public function getCollection()
4849
'key' => $key,
4950
'value' => isset($parameter['value']) ? $parameter['value'] : '',
5051
'type' => 'text',
51-
'enabled' => true
52+
'enabled' => true,
5253
];
5354
})->values()->toArray(),
5455
],
5556
'description' => $route['description'],
56-
'response' => []
57-
]
57+
'response' => [],
58+
],
5859
];
59-
})->toArray()
60+
})->toArray(),
6061
];
61-
})->values()->toArray()
62+
})->values()->toArray(),
6263
];
6364

6465
return json_encode($collection);
6566
}
66-
67-
}
67+
}

0 commit comments

Comments
 (0)