Fix extractor, markdown formatter, and tests

This commit is contained in:
William DURAND 2012-07-13 15:26:36 +02:00
parent 4b1990b688
commit fce0f5d5a6
3 changed files with 7 additions and 10 deletions

View File

@ -227,14 +227,14 @@ class ApiDocExtractor
{
$comment = $reflected->getDocComment();
// Remove PHPDoc
$comment = preg_replace('/^\s+\* @[\w0-9]+.*/msi', '', $comment);
// let's clean the doc block
$comment = str_replace('/**', '', $comment);
$comment = str_replace('*/', '', $comment);
$comment = preg_replace('/^\s*\* ?/m', '', $comment);
// Remove everything (and including) first annotation
$comment = preg_replace('/@[\w0-9]+\(.*/msi', '', $comment);
return trim($comment);
}
}

View File

@ -27,8 +27,10 @@ class MarkdownFormatter extends AbstractFormatter
$markdown .= "\n\n";
if (isset($data['documentation']) && !empty($data['documentation'])) {
$markdown .= $data['documentation'];
$markdown .= "\n\n";
if (isset($data['description']) && 0 === strcmp($data['description'], $data['documentation'])) {
$markdown .= $data['documentation'];
$markdown .= "\n\n";
}
}
if (isset($data['requirements']) && !empty($data['requirements'])) {

View File

@ -126,11 +126,6 @@ _Action without HTTP verb_
_This method is useful to test if the getDocComment works. And, it supports multilines until the first '@' char._
#### Documentation ####
This method is useful to test if the getDocComment works.
And, it supports multilines until the first '@' char.
#### Requirements ####
**id**