Skip to content

Commit 7174737

Browse files
committed
Fixes issue #83
1 parent 6c2954d commit 7174737

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/Mpociot/ApiDoc/Generators/LaravelGenerator.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,20 @@ protected function getUri($route)
2727
*/
2828
public function processRoute($route, $bindings = [], $withResponse = true)
2929
{
30-
$response = '';
31-
32-
if ($withResponse) {
33-
$response = $this->getRouteResponse($route, $bindings);
34-
}
30+
$content = '';
3531

3632
$routeAction = $route->getAction();
3733
$routeGroup = $this->getRouteGroup($routeAction['uses']);
3834
$routeDescription = $this->getRouteDescription($routeAction['uses']);
3935

40-
if ($response->headers->get('Content-Type') === 'application/json') {
41-
$content = json_encode(json_decode($response->getContent()), JSON_PRETTY_PRINT);
42-
} else {
43-
$content = $response->getContent();
36+
37+
if ($withResponse) {
38+
$response = $this->getRouteResponse($route, $bindings);
39+
if ($response->headers->get('Content-Type') === 'application/json') {
40+
$content = json_encode(json_decode($response->getContent()), JSON_PRETTY_PRINT);
41+
} else {
42+
$content = $response->getContent();
43+
}
4444
}
4545

4646
return $this->getParameters([

0 commit comments

Comments
 (0)