mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 07:41:43 +03:00
adds the ability to modify the documentation
property inside custom extractor handlers
This commit is contained in:
parent
3b6223feb2
commit
f67dfb05db
@ -266,6 +266,14 @@ class ApiDoc
|
||||
$this->documentation = $documentation;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getDocumentation()
|
||||
{
|
||||
return $this->documentation;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Boolean
|
||||
*/
|
||||
|
@ -239,6 +239,9 @@ class ApiDocExtractor
|
||||
// create a new annotation
|
||||
$annotation = clone $annotation;
|
||||
|
||||
// doc
|
||||
$annotation->setDocumentation($this->commentExtractor->getDocCommentText($method));
|
||||
|
||||
// parse annotations
|
||||
$this->parseAnnotations($annotation, $route, $method);
|
||||
|
||||
@ -247,7 +250,7 @@ class ApiDocExtractor
|
||||
|
||||
// description
|
||||
if (null === $annotation->getDescription()) {
|
||||
$comments = explode("\n", $this->commentExtractor->getDocCommentText($method));
|
||||
$comments = explode("\n", $annotation->getDocumentation());
|
||||
// just set the first line
|
||||
$comment = trim($comments[0]);
|
||||
$comment = preg_replace("#\n+#", ' ', $comment);
|
||||
@ -259,9 +262,6 @@ class ApiDocExtractor
|
||||
}
|
||||
}
|
||||
|
||||
// doc
|
||||
$annotation->setDocumentation($this->commentExtractor->getDocCommentText($method));
|
||||
|
||||
// input (populates 'parameters' for the formatters)
|
||||
if (null !== $input = $annotation->getInput()) {
|
||||
$parameters = array();
|
||||
|
Loading…
x
Reference in New Issue
Block a user