diff --git a/Annotation/ApiDoc.php b/Annotation/ApiDoc.php index 793e6ef..744d340 100644 --- a/Annotation/ApiDoc.php +++ b/Annotation/ApiDoc.php @@ -279,6 +279,14 @@ class ApiDoc $this->documentation = $documentation; } + /** + * @return string + */ + public function getDocumentation() + { + return $this->documentation; + } + /** * @return Boolean */ diff --git a/Extractor/ApiDocExtractor.php b/Extractor/ApiDocExtractor.php index 3eb69d9..02fe52d 100644 --- a/Extractor/ApiDocExtractor.php +++ b/Extractor/ApiDocExtractor.php @@ -240,6 +240,9 @@ class ApiDocExtractor // create a new annotation $annotation = clone $annotation; + // doc + $annotation->setDocumentation($this->commentExtractor->getDocCommentText($method)); + // parse annotations $this->parseAnnotations($annotation, $route, $method); @@ -248,7 +251,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); @@ -260,9 +263,6 @@ class ApiDocExtractor } } - // doc - $annotation->setDocumentation($this->commentExtractor->getDocCommentText($method)); - // input (populates 'parameters' for the formatters) if (null !== $input = $annotation->getInput()) { $parameters = array();