mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 15:51:48 +03:00
Merge pull request #221 from kmfk/documentation-in-handler
Modify the `documentation` property inside annotation handlers
This commit is contained in:
commit
c2d36d9ef0
@ -279,6 +279,14 @@ class ApiDoc
|
|||||||
$this->documentation = $documentation;
|
$this->documentation = $documentation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getDocumentation()
|
||||||
|
{
|
||||||
|
return $this->documentation;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Boolean
|
* @return Boolean
|
||||||
*/
|
*/
|
||||||
|
@ -240,6 +240,9 @@ class ApiDocExtractor
|
|||||||
// create a new annotation
|
// create a new annotation
|
||||||
$annotation = clone $annotation;
|
$annotation = clone $annotation;
|
||||||
|
|
||||||
|
// doc
|
||||||
|
$annotation->setDocumentation($this->commentExtractor->getDocCommentText($method));
|
||||||
|
|
||||||
// parse annotations
|
// parse annotations
|
||||||
$this->parseAnnotations($annotation, $route, $method);
|
$this->parseAnnotations($annotation, $route, $method);
|
||||||
|
|
||||||
@ -248,7 +251,7 @@ class ApiDocExtractor
|
|||||||
|
|
||||||
// description
|
// description
|
||||||
if (null === $annotation->getDescription()) {
|
if (null === $annotation->getDescription()) {
|
||||||
$comments = explode("\n", $this->commentExtractor->getDocCommentText($method));
|
$comments = explode("\n", $annotation->getDocumentation());
|
||||||
// just set the first line
|
// just set the first line
|
||||||
$comment = trim($comments[0]);
|
$comment = trim($comments[0]);
|
||||||
$comment = preg_replace("#\n+#", ' ', $comment);
|
$comment = preg_replace("#\n+#", ' ', $comment);
|
||||||
@ -260,9 +263,6 @@ class ApiDocExtractor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// doc
|
|
||||||
$annotation->setDocumentation($this->commentExtractor->getDocCommentText($method));
|
|
||||||
|
|
||||||
// input (populates 'parameters' for the formatters)
|
// input (populates 'parameters' for the formatters)
|
||||||
if (null !== $input = $annotation->getInput()) {
|
if (null !== $input = $annotation->getInput()) {
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user