|
@@ -57,7 +57,8 @@ class Generator
|
|
|
$controller = new ReflectionClass($class);
|
|
|
$method = $controller->getMethod($method);
|
|
|
|
|
|
- $routeGroup = $this->getRouteGroup($controller, $method);
|
|
|
+ list($routeGroupName, $routeGroupDescription) = $this->getRouteGroup($controller, $method);
|
|
|
+
|
|
|
$docBlock = $this->parseDocBlock($method);
|
|
|
$bodyParameters = $this->getBodyParameters($method, $docBlock['tags']);
|
|
|
$queryParameters = $this->getQueryParameters($method, $docBlock['tags']);
|
|
@@ -69,7 +70,8 @@ class Generator
|
|
|
|
|
|
$parsedRoute = [
|
|
|
'id' => md5($this->getUri($route).':'.implode($this->getMethods($route))),
|
|
|
- 'group' => $routeGroup,
|
|
|
+ 'groupName' => $routeGroupName,
|
|
|
+ 'groupDescription' => $routeGroupDescription,
|
|
|
'title' => $docBlock['short'],
|
|
|
'description' => $docBlock['long'],
|
|
|
'methods' => $this->getMethods($route),
|
|
@@ -271,7 +273,7 @@ class Generator
|
|
|
* @param ReflectionClass $controller
|
|
|
* @param ReflectionMethod $method
|
|
|
*
|
|
|
- * @return string
|
|
|
+ * @return array The route group name and description
|
|
|
*/
|
|
|
protected function getRouteGroup(ReflectionClass $controller, ReflectionMethod $method)
|
|
|
{
|
|
@@ -281,7 +283,12 @@ class Generator
|
|
|
$phpdoc = new DocBlock($docBlockComment);
|
|
|
foreach ($phpdoc->getTags() as $tag) {
|
|
|
if ($tag->getName() === 'group') {
|
|
|
- return $tag->getContent();
|
|
|
+ $routeGroup = trim($tag->getContent());
|
|
|
+ $routeGroupParts = explode("\n", $tag->getContent());
|
|
|
+ $routeGroupName = array_shift($routeGroupParts);
|
|
|
+ $routeGroupDescription = implode("\n", $routeGroupParts);
|
|
|
+
|
|
|
+ return [$routeGroupName, $routeGroupDescription];
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -291,12 +298,16 @@ class Generator
|
|
|
$phpdoc = new DocBlock($docBlockComment);
|
|
|
foreach ($phpdoc->getTags() as $tag) {
|
|
|
if ($tag->getName() === 'group') {
|
|
|
- return $tag->getContent();
|
|
|
+ $routeGroupParts = explode("\n", $tag->getContent());
|
|
|
+ $routeGroupName = array_shift($routeGroupParts);
|
|
|
+ $routeGroupDescription = implode("\n", $routeGroupParts);
|
|
|
+
|
|
|
+ return [$routeGroupName, $routeGroupDescription];
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- return $this->config->get(('default_group'));
|
|
|
+ return [$this->config->get(('default_group')), ''];
|
|
|
}
|
|
|
|
|
|
private function normalizeParameterType($type)
|