Skip to content

Commit

Permalink
Check if reflectionclass has a doc block
Browse files Browse the repository at this point in the history
  • Loading branch information
mpociot committed Jun 13, 2016
1 parent 74f38a1 commit 62690bf
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Mpociot/ApiDoc/Generators/AbstractGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,12 @@ protected function getRouteGroup($route)
list($class, $method) = explode('@', $route);
$reflection = new ReflectionClass($class);
$comment = $reflection->getDocComment();
$phpdoc = new DocBlock($comment);
foreach ($phpdoc->getTags() as $tag) {
if ($tag->getName() === 'resource') {
return $tag->getContent();
if ($comment) {
$phpdoc = new DocBlock($comment);
foreach ($phpdoc->getTags() as $tag) {
if ($tag->getName() === 'resource') {
return $tag->getContent();
}
}
}

Expand Down

0 comments on commit 62690bf

Please sign in to comment.